离子建立子页面

问题描述:

我想设置一个应用程序与多个屏幕和一些屏幕应该有子屏幕。标签工作正常,并与正确的模板连接,但子页面不起作用。我甚至不能浏览到设置的网址。当我点击图标时,它会转到默认情况下,我已在其他方法中设置。离子建立子页面

APP JS文件

$stateProvider 

// setup an abstract state for the tabs directive 
.state('tab', { 
    url: '/tab', 
    abstract: true, 
    templateUrl: 'templates/tabs.html' 
}) 

// Each tab has its own nav history stack: 

.state('tab.home', { 
    url: '/home', 
     views: { 
     'tab-home': { 
     templateUrl: 'templates/tab-home.html', 
     controller: 'HomeCtrl' 
     } 
    } 
}) 

.state('tab.aboutApps', { 
    url: '/aboutApps', 
    views: { 
    'tab-aboutApps': { 
     templateUrl: 'templates/tab-aboutApps.html' 
    } 
    } 
}) 
.state('tab.aboutApps.pricing', { 
    url: '/aboutApps/pricing', 
    views: { 
    'detail-pricing': { 
     templateUrl: 'templates/detail-pricing.html' 
    } 
    } 
}) 
.state('tab.aboutApps.features', { 
    url: '/features', 
    views: { 
     'detail-features': { 
      templateUrl: 'templates/detail-features.html' 
     } 
    } 
}) 

HTML

<ion-item class="text-wrap" href="#/tab/aboutApps/features"> 
    <p>Features</p> 
    <ion-nav-view title="Features" name="detail-features" class="text-wrap"</ion-nav-view> 
</ion-item> 
<ion-item class="text-wrap" href="#/tab/aboutApps/pricing"> 
    <p>Pricing</p> 
    <ion-nav-view title="Pricing" name="detail-priceing" class="text-wrap"></ion-nav-view> 
</ion-item> 

我是新来的离子和不明白为什么这不会工作。我在想,有创造的路径或URL

一个问题,你使用:

href="#/tab/aboutApps/pricing" 

您离子项目, 更改为:

ui-sref="tab.aboutApps.pricing" 

这是一个将链接绑定到状态的指令。

你可以阅读更多关于它在这里:

http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.directive:ui-sref