【发布时间】:2014-12-10 17:30:51
【问题描述】:
没有错误。
我可以访问 /teams 中的团队列表和 /teams/2 中的特定团队,其中 2 是团队的 ID。
$stateProvider.state('app.teams.team', {
url: '/:team',
templateUrl: 'templates/teams/team.html',
controller: 'TeamCtrl',
resolve: {
team: function($stateParams, TeamsService) {
return TeamsService.getTeam($stateParams.team)
}
}
})
我无法访问 /teams/2/roster 中的名册。
$stateProvider.state('app.teams.team.roster', {
url: '/roster',
templateUrl: 'templates/teams/roster.html'
})
页面加载没有错误,并显示templates/teams/team.html而不是templates/teams/roster.html
【问题讨论】:
-
team.html 中有 ui-view 指令吗?
-
不,我不知道。我想用 roster.html 覆盖 team.html,我是不是走错了路?
标签: angularjs ionic-framework angularjs-routing