index.html をテンプレートとして使用するいくつかのビューを持つルートがいくつかあります。特定のビュー (ログイン ページなど) で、index.html をテンプレートとして使用したくありません。Angular でこれを行う方法:
My routes:
.when('/user/:id/update',{
templateUrl: 'views/updateUser.html',
controller: 'updateUserCtrl'
})
.when('/role', {
templateUrl: 'views/role.html',
controller: 'RoleCtrl'
})
.when('/login', {
controller: 'RoleCtrl' //Here I want a page withou template
})
私はすでに次のように ui-route を使用しようとしました:
$stateProvider
.state('contacts', {
abstract: true,
template: '<ui-view/>',
url: '/contacts'
})
.state('contacts.list', {
// loaded into ui-view of parent's template
templateUrl: 'contacts.list.html',
url: '/list'
})
.state('contacts.detail', {
// loaded into ui-view of parent's template
templateUrl: 'contacts.detail.html',
url: '/detail'
})
どちらの場合も、ページは常に index.html から継承されます。