本篇慢慢記錄UI-Router相關的操作心得
UI-Router $state帶參數轉頁
$state.go('admin.productlist.uuid',
{
uuid: product.FD_CurrentFilePathHash
});
// Admin page for productlist/:uuid
$stateProvider
.state('admin', {
abstract: true,
template: "",
data: {
authorizedRoles: [USER_ROLES.admin]
}
})
.state('admin.productlist.uuid', {
/*manage user page */
url: '/productlist/:uuid',
views: {
// the main template will be placed here (relatively named)
// replace unnamed view '
' in this state's parent state, 'home'.
'': {
templateUrl: 'partials/global.index.html'
},
//viewname@statusname
// the child views will be defined here (absolutely named)
'header@admin.productlist': {
templateUrl: 'partials/global.header.html',
controller: 'HeaderCtrl'
},
'main_body@admin.productlist': {
templateUrl: 'partials/product_dm/productlist.body.html',
controller: 'ProductListCtrl'
},
// for column two, we'll define a separate controller
'footer@admin.productlist': {
templateUrl: 'partials/global.footer.html'
}
},
data:{
pageTitle: '產品DM'
}
});
沒有留言:
張貼留言
留個話吧:)