我有以下状态:
$stateProvider
.state('app', {
url: '/app',
abstract: true,
templateUrl: 'templates/menu.html',
controller: 'AppCtrl'
})
.state('app.myClients', {
url: '/myClients',
//templateUrl: 'templates/myClients/myClients.html',
views: {
'menuContent': {
templateUrl: 'templates/myClients/myClients.html',
controller: 'clientController'
}
}
})
.state('app.myClients.rapida', {
url: '/rapida',
//templateUrl: 'templates/myClients/myClients.html',
views: {
'content_rapida@menuContent@app': {
templateUrl: 'templates/myClients/partials/rapida.html',
// controller: 'qSearchController'
}
}
})
menu.html
<ion-side-menus hide-back-button="true" enable-menu-with-back-views="true" ng-controller="menuCtrl">
<ion-nav-view name="menuContent"></ion-nav-view>
</ion-side-menu-content>
myClients.html
<div class="div_clients" ng-controller="clientController">
<ion-nav-view name="content_rapida"></ion-nav-view>
<ion-nav-view name="content_lenta"></ion-nav-view>
<div class="clientFilter">
<h1 class="searchTitle">
FILTROS
</h1>
<div class="filtereRow">
Filtros (0)
<div class="executeBt">
<button class="execute" ng-click="">Ejecutar<i class="ion-ios-loop execute-icon"></i></button>
</div>
</div>
</div>
</div>
rapida.html
<h1>HI guys!</h1>
这有效
/app/myClients
这不起作用
/app/myClients/rapida
答案 0 :(得分:0)
你试过的Hace 的&#39; content_rapida&#39; 强> 代替 的&#39; content_rapida @ menuContent @应用&#39; 强> 在州定义?
您的观点应该已经确定了&#39; content_rapida&#39;在父视图中......
答案 1 :(得分:0)
我终于做到了!
我改变了这个
.state('app.myClients.rapida', {
url: '/rapida',
//templateUrl: 'templates/myClients/myClients.html',
views: {
'content_rapida@menuContent@app': {
templateUrl: 'templates/myClients/partials/rapida.html',
controller: 'qSearchController'
}
}
})
到此
.state('app.myClients.rapida', {
url: '/rapida',
templateUrl: 'templates/myClients/myClients.html',
views: {
'content_rapida': {
templateUrl: 'templates/myClients/partials/rapida.html',
controller: 'qSearchController'
}
}
})
请注意,我必须使用templateUrl两次。