Angular 离子深度链接错误,离子3/5应用错误
连接错误 错误:未捕获(承诺中):TypeError:Object(…)不是函数 TypeError:对象(…)不是函数 在Deeplinks.route()上 代码:Angular 离子深度链接错误,离子3/5应用错误,angular,ionic3,Angular,Ionic3,连接错误 错误:未捕获(承诺中):TypeError:Object(…)不是函数 TypeError:对象(…)不是函数 在Deeplinks.route()上 代码: constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, private deeplinks: Deeplinks) { platform.ready().then(() => { // Okay, so th
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, private deeplinks: Deeplinks) {
platform.ready().then(() => {
// 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();
this.deeplinks.route({
'/': {},
'/reset-password/:Id': MmresetpasswordPage
})
.subscribe(match => {
alert(JSON.stringify(match));
}, nomatch => {
alert(JSON.stringify(nomatch));
});
});
安装deeplinks的v5:
npmi-s@ionic native/deeplinks@5
导入组件
s和模块
s,如:从'@ionic native/Deeplinks/ngx'导入{Deeplinks}
(注意/ngx
)
然后在component.ts
中声明如下:构造函数(私有deeplinks:deeplinks){}
然后在
app.module.ts
中提供如下内容:providers:[Deeplinks]
您需要在构造函数中为您的对象设置public/private。编解码器转换器:给我一个例子?我在版本3和版本5中遇到的错误相同。请建议一个解决方案我有相同的配置,但仍然与上面提到的代码有错误:下面是我得到的错误:core.js:1449 error error:Uncaught(承诺):TypeError:Object(…)不是函数TypeError:Object(…)不是函数。