【发布时间】:2016-12-16 15:02:43
【问题描述】:
我已经注册了一个状态 test 和一个孩子 .child1 ,这里的父母 (test) 工作正常。当我导航到状态test.child1 URL 更改为#/test/child1 但视图保持不变,子模板不起作用
angular.module('uiRouterSample.contacts', [
'ui.router'
])
.config(
[ '$stateProvider', '$urlRouterProvider',
function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state('test',{
url:'/test',
template:'<a ui-sref="test">Parent</a> -> <a ui-sref=".child1">child1</a>',
controller: ['$scope', '$state', 'contacts', 'utils',
function ( $scope, $state, contacts, utils) {
}]
}).state('test.child1',{
url:'/child1',
template:'Child template working fine'
})
}
]
)
【问题讨论】:
标签: angularjs angular-ui-router angular-ui