Ionic2,如何将自定义插件(appsee或uxcam)导入Ionic App

时间:2017-12-05 02:16:48

标签: angular ionic2 cordova-plugins ionic3 uxcam

我正在尝试使用AppseeUXcam

我尝试了下面的导入,但没有运气 //从@ ion-native / appsee';

导入{Appsee}

另外,我看到你必须声明有问题的变量来识别变量,我就像下面这样做了

声明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(() => {
    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();
    });
  }
}

我还尝试添加公共appsee:Appsee到构造函数但仍然没有运气。

感谢任何指导。我收到 ReferenceError:未定义cordova。

如何导入自定义插件appsee

编辑添加建议的代码 声明var Appsee:any;

{{1}}

1 个答案:

答案 0 :(得分:0)

您只需将其放在imports下,如下所示。

//your other imports here

declare var Appsee:any;

@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  @ViewChild(Nav) nav: Nav;