我正在使用嵌套视图开发我的 UI-Router 应用程序。我定义了一些这样的状态:
$stateProvider
.state('parent', {
url: "/parent",
views: {
'area1': {templateUrl : 'parentView.html'},
'area2' : ... // some other areas + template
}
})
.state('parent.child1', {
url: "/child1",
views: {
'area1' : {templateUrl : 'child1View.html'},
'area2' : ... // still some other areas, not changing
}
})
.state('parent.child2', {
url: "/child2",
views: {
'area1' : {templateUrl : 'child2View.html'},
'area2' : ... // still some other areas, not changing
}
})
使用该应用程序时,我的主视图分为几个区域。在第一个区域,我使用了一个特定的 html 文件。如果我点击一个链接,应用程序会使用$state.go('myState')
. 此时,URL 已更改,但页面中未加载子视图。
我在网站上搜索了答案,我从另一个似乎在这里遇到同样问题的人那里找到了这个问题:Angular Router - Url changes but view does not load
你知道我错过了什么吗?
对不起英语不好