我使用离子原生Deeplinks插件和下面的代码:
import {Component, ViewChild} from '@angular/core';
import {Platform, Nav, ionicBootstrap} from 'ionic-angular';
import {Deeplinks} from 'ionic-native';
import {AboutPage} from './pages/about/about';
import {HatDetailPage} from './pages/hat/hat';
@Component({
template: '<ion-nav [root]="rootPage"></ion-nav>',
})
class MyApp {
@ViewChild(Nav) nav:Nav;
constructor(private _platform: Platform) {}
ngAfterViewInit() {
this._platform.ready().then(() => {
Deeplinks.routeWithNavController(this.nav, {
'/about-us': AboutPage,
'/hats/:hatId': HatDetailPage
});
});
}
});
我测试了它,我可以打开应用程序,但不能将我引导到页面,有人有想法吗?