本文整理匯總了TypeScript中angular-ui-router.IUrlRouterProvider類的典型用法代碼示例。如果您正苦於以下問題:TypeScript IUrlRouterProvider類的具體用法?TypeScript IUrlRouterProvider怎麽用?TypeScript IUrlRouterProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了IUrlRouterProvider類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: NavConfig
export default function NavConfig(
$stateProvider: IStateProvider,
$urlRouterProvider: IUrlRouterProvider
): void {
$urlRouterProvider.when('', '/');
$stateProvider.state(navState);
}
示例3: 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'
}
}
});
}]);
示例4: HomeConfig
export default function HomeConfig(
$stateProvider: IStateProvider,
$urlRouterProvider: IUrlRouterProvider
): void {
$stateProvider.state(homeState);
$urlRouterProvider.when('/', '/home');
}
示例5: function
.config(["$urlRouterProvider", "$stateProvider", function (route: IUrlRouterProvider, stateProvider: IStateProvider) {
route.otherwise("/state1/");
stateProvider
.state("state1", {
url: "/state1/:detail",
templateUrl: "app/view1/view1.html",
controller: "View1Controller as vm"
})
.state("state2", {
url: "/state2",
templateUrl: "app/view2/view2.html",
controller: View2Controller,
})
.state("state3", {
url: "/state3/:detail/:viewId",
templateUrl: "app/view1/view1.html",
controller: "View1Controller as vm"// same view as View1
})
.state("state4", {
url: "/state4",
template: "<some-component></some-component>",
});
}]);
示例6: function
function($stateProvider: IStateProvider,
$urlRouterProvider: IUrlRouterProvider) {
// App Routing
$urlRouterProvider.otherwise('/dashboard');
if(CONSTANTS.atlas.ui.frontendOnly){
$stateProvider
.state('dashboard', {
url: '/dashboard',
template: '<dashboard></dashboard>',
data: {
menu: {
name: 'Dashboard',
icon: 'fa-dashboard'
}
}
})
// .state('page3', {
// url: '/page3',
// template: '<page3></page3>',
// data: {
// menu: {
// name: 'Localization',
// icon: 'fa-calculator'
// }
// }
// });
}}]);
示例7: routes
export function routes($stateProvider: IStateProvider, $urlRouterProvider: IUrlRouterProvider) {
$stateProvider
.state('app', {
url: '/app',
abstract: true,
template: require('./App/app.html')
});
$urlRouterProvider.otherwise('/app/language');
}
示例8: CoreConfiguration
/* @ngInject */
function CoreConfiguration($locationProvider : ILocationProvider, $urlRouterProvider : IUrlRouterProvider) {
$locationProvider.html5Mode(true);
var init = true;
$urlRouterProvider.rule(function ($injector, $location) {
if (init && $location.path() !== '/') {
$location.replace().url('/?redir=' + $location.path());
}
init = false;
});
}
示例9: routeConfig
function routeConfig($stateProvider: IStateProvider,
$urlRouterProvider: IUrlRouterProvider) {
$stateProvider
.state('login', {
url: '/login',
controller: 'LoginController as ctrl',
templateUrl: 'login/login.html'
})
$urlRouterProvider.otherwise('/login');
}
示例10: constructor
constructor($stateProvider: IStateProvider, $urlRouterProvider: IUrlRouterProvider){
$urlRouterProvider.otherwise("/products");
$stateProvider
.state("products", {
url: "/products",
template: "<app-product-list></app-product-list>"
})
.state("productDetails", {
url: "/product/:id",
template: "<app-product></app-product>"
});
}