【发布时间】:2016-02-19 05:11:31
【问题描述】:
我有一个 html 页面父亲:
<div id="..." class="container">
<pp-nav></pp-nav>
<div ui-view></div>
</div>
这是我的控制器,有一个父亲和两个孩子:
export function routerConfig($stateProvider: angular.ui.IStateProvider, $urlRouterProvider: angular.ui.IUrlRouterProvider) {
$stateProvider
.state('gestionePeP', {
url: '/gestionePeP',
templateUrl: '.../gestionePeP/gestionePeP.html'
})
.state('gestionePeP.puntiAttivazione', {
url: '/puntiAttivazione',
templateUrl: '.../gestionePeP/puntiAttivazione.html'
})
.state('gestionePeP.gestioneContenuti', {
url: '/gestioneContenuti',
templateUrl: '.../gestionePeP/gestioneContenuti.html'
});
我希望当我转到父页面时,stateprovider 打开父 html 页面,其中包含第一个子页面。 我该怎么做?
如果我用
将链接放在父亲的按钮内ui-sref="gestionePeP.puntiAttivazione"
它会打开正确的页面。但我想要没有任何点击的相同行为。 我试过 $state.go('gestionePeP.puntiAttivazione') 但它进入了循环。 我该如何解决?
【问题讨论】:
标签: typescript angular-ui-router angular-ui state