本文整理匯總了TypeScript中angular-ui-router.IUrlRouterProvider.when方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript IUrlRouterProvider.when方法的具體用法?TypeScript IUrlRouterProvider.when怎麽用?TypeScript IUrlRouterProvider.when使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類angular-ui-router.IUrlRouterProvider
的用法示例。
在下文中一共展示了IUrlRouterProvider.when方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: function
function($stateProvider: IStateProvider,
$urlRouterProvider: IUrlRouterProvider) {
$urlRouterProvider.when('/storage', '/storage/dataasset');
$urlRouterProvider.when('/storage/catalog', '/storage/catalog');
$stateProvider
.state('storage', {
url: '/storage',
template: '<storage></storage>',
data : {
menu: {
name: 'Source Data',
icon: 'glyphicon-inbox',
showSubmenu: true
}
}
})
.state('storage.createdataasset', {
url: '/createdataasset',
template: '<create-data-asset></create-data-asset>',
data : {
menu: {
name: 'Create RFo Data Assets'
}
}
})
.state('storage.catalog', {
url: '/catalog',
template: '<catalog></catalog>',
data: {
menu: {
name: 'Data Catalog',
icon: 'glyphicon-inbox',
showSubmenu: true
}
}
}).state('storage.catalog.structure', {
url: '/structure/:sourceName/:structureName',
template: '<structure></structure>',
data: {
menu: {
name: 'File Browser'
}
}
}).state('storage.catalog.unstructuredfiles', {
url: '/unstructuredfiles/:sourceName',
template: '<unstructuredfiles></unstructuredfiles>',
data: {
menu: {name: 'Unstructured Files'}
}
}).state('storage.catalog.createstructure', {
url: '/createstructure',
template: '<createstructure></createstructure>',
data: {
menu: {name: 'Create Structure'}
}
});
}]);
示例2: HomeConfig
export default function HomeConfig(
$stateProvider: IStateProvider,
$urlRouterProvider: IUrlRouterProvider
): void {
$stateProvider.state(homeState);
$urlRouterProvider.when('/', '/home');
}
示例3: NavConfig
export default function NavConfig(
$stateProvider: IStateProvider,
$urlRouterProvider: IUrlRouterProvider
): void {
$urlRouterProvider.when('', '/');
$stateProvider.state(navState);
}
示例4: function
function($stateProvider: IStateProvider,
$urlRouterProvider: IUrlRouterProvider) {
$urlRouterProvider.when('/page4', '/page4/tab1');
$stateProvider
.state('page4', {
url: '/page4',
template: '<page4></page4>',
data: {
menu: {
name: 'Module Example',
icon: 'fa-folder-open',
showSubmenu: true
}
}
}).state('page4.tab1', {
url: '/tab1',
template: '<page4-tab1></page4-tab1>',
data: {
menu: {
name: 'Tab 1'
}
}
}).state('page4.tab2', {
url: '/tab2',
template: '<page4-tab2></page4-tab2>',
data: {
menu: {
name: 'Tab 2'
}
}
});
}]);
示例5: function
function($stateProvider: IStateProvider,
$urlRouterProvider: IUrlRouterProvider) {
$urlRouterProvider.when('/graphs', '/graphs/hierarchy');
$stateProvider
.state('graphs', {
url: '/graphs',
template: '<graphs></graphs>',
data: {
menu: {
name: 'Graph Examples',
icon: 'fa-download',
showSubmenu: true
}
}
}).state('graphs.hierarchy', {
url: '/hierarchy',
template: '<hierarchy-example></hierarchy-example>',
data: {menu: {
name: 'Hierarchy'
}
}
}).state('graphs.workflow1', {
url: '/workflow1',
template: '<workflow-example></workflow-example>',
data: {
menu: {
name: 'Workflow 1'
}
}
}).state('graphs.workflow2', {
url: '/workflow2',
template: '<workflow2-example></workflow2-example>',
data: {
menu: {
name: 'Workflow 2'
}
}
}).state('graphs.workflow3', {
url: '/workflow3',
template: '<workflow3-example></workflow3-example>',
data: {
menu: {
name: 'Workflow 3'
}
}
});
}]);
示例6: function
function($stateProvider: IStateProvider,
$urlRouterProvider: IUrlRouterProvider) {
$urlRouterProvider.when('/reporting-studio', '/reporting-studio/reporting-universe');
$stateProvider
.state('reporting-studio', {
url: '/reporting-studio',
template: '<reporting-studio></reporting-studio>',
data : {
menu: {
name: 'Reporting Studio',
icon: 'glyphicon-inbox',
showSubmenu: true
}
}
})
.state('reporting-studio.reporting-universe', {
url: '/reporting-universe',
template: '<reporting-universe></reporting-universe>',
data : {
menu: {
name: 'Reporting Universe'
}
}
})
.state('reporting-studio.tag-sample', {
url: '/tag-sample',
template: '<tag-sample></tag-sample>',
data : {
menu: {
name: 'Tag Sample'
}
}
})
.state('reporting-studio.sample', {
url: '/sample',
template: '<sample></sample>',
data: {
menu: {
name: 'Reporting Sample'
}
}
})
}]);
示例7: function
function($stateProvider: IStateProvider,
$urlRouterProvider: IUrlRouterProvider) {
$urlRouterProvider.when('/dg', '/dg/client');
$urlRouterProvider.when('/dg/good', '/dg/good/list');
$urlRouterProvider.when('/dg/order', '/dg/order/list');
$stateProvider
.state('dg', {
url: '/dg',
template: '<dg></dg>',
data : {
menu: {
name: 'Data Labs',
icon: 'glyphicon-inbox',
showSubmenu: true
}
}
}).state('dg.client', {
url: '/client',
template: '<client></client>',
data : {
menu: {
name: 'Client Manage'
}
}
}).state('dg.good', {
url: '/good',
template: '<good></good>',
data: {
menu: {
name: 'Good Manage',
icon: 'fa-folder-open'
}
}
}).state('dg.good.list', {
url: '/list',
template: '<good-list></good-list>',
data: {
menu: {
name: 'Tab 1'
}
}
}).state('dg.good.detail', {
url: '/detail/:id',
template: '<good-detail></good-detail>',
data: {
menu: {
name: 'Tab 2'
}
}
}).state('dg.order', {
url: '/order',
template: '<order></order>',
data: {
menu: {
name: 'Order Manage'
}
}
}).state('dg.order.list', {
url: '/list',
template: '<order-list></order-list>',
data: {
menu: {
name: 'Order List'
}
}
}).state('dg.order.detail', {
url: '/detail/:id',
template: '<order-detail></order-detail>',
data: {
menu: {
name: 'Tab 2'
}
}
}).state('dg.brand', {
url: '/brand',
template: '<brand></brand>',
data: {
menu: {
name: 'Brand Manage'
}
}
}).state('dg.category', {
url: '/category',
template: '<category></category>',
data: {
menu: {
name: 'Category Manage'
}
}
});
}]);