Hello,
For few days I’m struggling with adding cordova plugins to my Ionic2 application. I tried several plugins and I always get the same error. Having the plugin added to my project (I used ionic plugin add
command) with a clobbers content like below:
<js-module src="plugin/www/pushmote.js" name="Pushmote">
<clobbers target="Pushmote" />
</js-module>
my understanding is that I should be able to use that plugin just with window.Pushmote
:
import {Page} from 'ionic-angular';
@Page({
templateUrl: 'build/pages/page3/page3.html'
})
export class Page3 {
constructor() {
window.Pushmote.startWithApplicationId(...);
}
}
Is that correct?
Unfortunately, it doesn’t work:
Error TS2339: Property ‘Pushmote’ does not exist on type ‘Window’.
This is not only about Pushmote plugin - it’s just a next random plugin I’ve tried to incorporate into my project with no success. I’m still getting exactly the same error. What am I doing wrong?
I’ve read this thread: Ionic 2 and custom plugin - #5 by mzagal and looks that theoretically I’m doing everything correctly, so what is wrong?