TypeError: Cannot read property 'constructor' of null

I get this error when using the intel security native plugin. What I am trying to do is read a value.
The error I don’t really understand as it states constructor. I do not specify a constructor in this part of the code nor is there a variable named constructor which has me confused. I can write using the api no problem.

The thing that I find confusing also is the this.intelSec.data.getData with no arguments that is how it is documented in the ionic API docs here: https://ionicframework.com/docs/v2/native/intel-security/
If I try to pass a numeric argument (the instanceID that should be parsed according to one part of the API) the code will not compile.

So what am I doing wrong? I am new to ionic, angular 2 and typescript (well versed in javascript and angular 1)
It seems to be something that I am missing in my understanding of typescript. I don’t think it is something to do with the API.

This is how I am reading the data

    readStorage(){
        this.intelSec.storage.read({id: this.pinId})
            .then(this.intelSec.data.getData)
            .then(
                (data: string) => {
                    console.log("+++ have read the data and is:"+data);
                }
            )
            .catch(
                (error: any) => {
                    console.log("+++ the error code:"+error.code+" message:"+error.message);
                }
            )
    }

This is the full stack trace of the error

03-30 11:16:54.540: I/chromium(15173): [INFO:CONSOLE(75468)] "EXCEPTION: Uncaught (in promise): TypeError: Cannot read property 'constructor' of null
03-30 11:16:54.540: I/chromium(15173): TypeError: Cannot read property 'constructor' of null
03-30 11:16:54.540: I/chromium(15173):     at checkAvailability (file:///android_asset/www/build/main.js:81923:27)
03-30 11:16:54.540: I/chromium(15173):     at callCordovaPlugin (file:///android_asset/www/build/main.js:82018:29)
03-30 11:16:54.540: I/chromium(15173):     at file:///android_asset/www/build/main.js:82046:28
03-30 11:16:54.540: I/chromium(15173):     at file:///android_asset/www/build/main.js:56742:17
03-30 11:16:54.540: I/chromium(15173):     at new t (file:///android_asset/www/build/polyfills.js:3:11969)
03-30 11:16:54.540: I/chromium(15173):     at tryNativePromise (file:///android_asset/www/build/main.js:56741:20)
03-30 11:16:54.540: I/chromium(15173):     at getPromise (file:///android_asset/www/build/main.js:56749:12)
03-30 11:16:54.540: I/chromium(15173):     at wrapOtherPromise (file:///android_asset/www/build/main.js:82045:92)
03-30 11:16:54.540: I/chromium(15173):     at file:///android_asset/www/build/main.js:82139:20
03-30 11:16:54.540: I/chromium(15173):     at value (file:///android_asset/www/build/main.js:115738:125)
03-30 11:16:54.540: I/chromium(15173):     at t.invoke (file:///android_asset/www/build/polyfills.js:3:9655)
03-30 11:16:54.540: I/chromium(15173):     at Object.onInvoke (file:///android_asset/www/build/main.js:36749:37)
03-30 11:16:54.540: I/chromium(15173):     at t.invoke (file:///android_asset/www/build/polyfills.js:3:9606)
03-30 11:16:54.540: I/chromium(15173):     at e.run (file:///android_asset/www/build/polyfills.js:3:7019)
03-30 11:16:54.540: I/chromium(15173):     at file:///android_asset/www/build/polyfills.js:3:4661", source: 

OK I managed to sort this out.
The demo code snippet in the API did not work for me. Maybe it is for an earlier angular or something I am not sure. But after looking at the source code of the plugin I noticed that the read() call returns a promise containing a number: the instance ID. The instance ID is then passed to the getData function, not a non arg call as in the API docs, as an argument so getData(instanceID).

This then works beautifully.
I don’t know if the API doc needs to be updated:

https://ionicframework.com/docs/v2/native/intel-security/

This is how my code looks when corrected:

    readStorage(){
        this.intelSec.storage.read({id: this.pinId})
            .then((instanceID: number) => this.intelSec.data.getData(instanceID))
            .then(
                (data: string) => {
                    console.log("+++ have read the data and is:"+data);
                }
            )
            .catch(
                (error: any) => {
                    console.log("+++ the error code:"+error.code+" message:"+error.message);
                }
            )
    }