【发布时间】:2018-05-18 14:34:57
【问题描述】:
我尝试如下导入,但没有运气 // 从 '@ionic-native/appsee' 导入 { Appsee };
在其他地方我看到你必须声明有问题的变量才能让打字稿识别变量,我在下面这样做了
声明 var cordova:any;
// import { Appsee } from '@ionic-native/appsee';
declare var cordova:any;
@Component({
templateUrl: 'app.html'
})
export class MyApp {
rootPage:any = LoginPage; // FOR TESTING
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
platform.ready().then(() => {
cordova.plugins.Appsee.start("my key");
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
});
}
}
我也尝试将 public appsee: Appsee 添加到构造函数中,但仍然没有成功。
感谢任何指导。我收到 ReferenceError: cordova is not defined.
如何导入自定义插件,appsee
编辑添加建议的代码 声明 var Appsee:any;
@Component({
templateUrl: 'app.html'
})
export class MyApp {
rootPage:any = LoginPage; // FOR TESTING
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
platform.ready().then(() => {
Appsee.start("my key");
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
});
}
}
【问题讨论】:
标签: angular ionic2 cordova-plugins ionic3 uxcam