0
我想在局部视图tab-suggestion
中创建一个按钮,该按钮指向另一个视图tab-profile
。问题是href="#/tab/profile"
没有做任何事情。标签nav中的链接工作得很好,但离子视图tab-suggestion
中的按钮没有。从模板html到其他页面的离子路径
如何使按钮工作指向profile
?这是我的代码:
//app.js
.state('tab', {
url: '/tab',
abstract: true,
templateUrl: 'templates/tabs.html'
})
.state('tab.suggestion', {
url: '/suggestion',
views: {
'tab-suggestion': {
templateUrl: 'templates/tab-suggestion.html',
controller: 'SuggestionCtrl'
}
}
})
.state('tab.profile', {
url: '/profile',
views: {
'tab-profile': {
templateUrl: 'templates/tab-profile.html',
controller: 'ProfileCtrl'
}
}
})
//index.html
<ion-nav-view></ion-nav-view>
//tab-suggestion
<a class="button" ng-if="randomConnection === 'maker'" href="#/tab/profile">Contact</a>
编辑: //tabs.html
<!-- Dashboard Tab -->
<ion-tab title="Home" icon-off="ion-home" icon-on="ion-home" href="#/tab/home">
<ion-nav-view name="tab-home"></ion-nav-view>
</ion-tab>
<ion-tab title="Suggestie" icon-off="ion-android-bulb" icon-on="ion-android-bulb" href="#/tab/suggestion">
<ion-nav-view name="tab-suggestion"></ion-nav-view>
</ion-tab>
<ion-tab title="Feed" icon-off="ion-arrow-graph-up-right" icon-on="ion-arrow-graph-up-right" href="#/tab/feed">
<ion-nav-view name="tab-feed"></ion-nav-view>
</ion-tab>
</ion-tabs>
@Ivaro是的,我的'tabs.html'使用'href',看我的编辑。 –
好的,你可以删除'ionic2'标签并添加'ionic'标签吗?我会删除我的评论以防止其他人混淆 – Ivaro18