本文整理汇总了TypeScript中angular-ui-router.IStateProvider类的典型用法代码示例。如果您正苦于以下问题:TypeScript IStateProvider类的具体用法?TypeScript IStateProvider怎么用?TypeScript IStateProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IStateProvider类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: appRun
/* @ngInject */
function appRun($stateProvider : IStateProvider, $urlRouterProvider : IUrlRouterProvider) {
$urlRouterProvider.otherwise("/");
$stateProvider.state('loading', {
url: "/?redir",
templateUrl: "/static/app/features/loading/loading.html",
controller: 'LoadingController',
resolve: {
/* @ngInject */
requirements: function(api, $rootScope, $location, $stateParams, $state) {
return api.getRooms().then(function (rooms) {
$rootScope.selectedRoomID = rooms[0];
$rootScope.rooms = rooms;
var states = $state.get();
if (!$stateParams.redir) {
$stateParams.redir = '/dashboard/';
}
states.forEach(function(state) {
if (state.url === $stateParams.redir) {
$state.go(state.name);
}
});
});
}
}
})
}
开发者ID:kodypeterson,项目名称:screeps,代码行数:28,代码来源:loading.route.ts
示例2: 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'
// }
// }
// });
}}]);
开发者ID:chenhenry,项目名称:chenhenry,代码行数:28,代码来源:app.routes.ts
示例3: NavConfig
export default function NavConfig(
$stateProvider: IStateProvider,
$urlRouterProvider: IUrlRouterProvider
): void {
$urlRouterProvider.when('', '/');
$stateProvider.state(navState);
}
开发者ID:CoolestProjects,项目名称:app_web,代码行数:7,代码来源:nav-config.ts
示例4: 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'}
}
});
}]);
开发者ID:chenhenry,项目名称:chenhenry,代码行数:60,代码来源:storage.routes.ts
示例5: AppConfig
export default function AppConfig(
$stateProvider: IStateProvider,
$mdThemingProvider: material.IThemingProvider,
$mdDateLocaleProvider: material.IDateLocaleProvider,
$httpProvider: IHttpProvider
): void {
$stateProvider.state(appState);
$mdThemingProvider.definePalette('Coolest-Projects-Palette', {
'50': '#d0ebff',
'100': '#84cbff',
'200': '#4cb3ff',
'300': '#0495ff',
'400': '#0084e5',
'500': '#000000',
'600': '#0060a7',
'700': '#004f89',
'800': '#003d6a',
'900': '#002c4c',
'A100': '#d0ebff',
'A200': '#84cbff',
'A400': '#0084e5',
'A700': '#004f89',
'contrastDefaultColor': 'light',
'contrastDarkColors': '50 100 200 A100 A200'
});
$mdThemingProvider.theme('default').primaryPalette('Coolest-Projects-Palette');
$mdDateLocaleProvider.formatDate = function(date: Date): string {
return moment(date).format('L');
};
}
开发者ID:CoolestProjects,项目名称:app_web,代码行数:30,代码来源:app-config.ts
示例6: 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>",
});
}]);
开发者ID:AmirSasson,项目名称:Angular1TypescriptSystemJs,代码行数:25,代码来源:boot.ts
示例7: HomeConfig
export default function HomeConfig(
$stateProvider: IStateProvider,
$urlRouterProvider: IUrlRouterProvider
): void {
$stateProvider.state(homeState);
$urlRouterProvider.when('/', '/home');
}
开发者ID:CoolestProjects,项目名称:app_web,代码行数:7,代码来源:home-config.ts
示例8: 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'
}
}
});
}]);
开发者ID:chenhenry,项目名称:chenhenry,代码行数:34,代码来源:page4.routes.ts
示例9: routes
export function routes($stateProvider: IStateProvider) {
$stateProvider
.state('scoreboard', {
url: '/scoreboard',
template: require('./scoreboard.html'),
controller: 'ScoreboardCtrl as vm'
});
}
开发者ID:saraarnad,项目名称:HipsterCat,代码行数:8,代码来源:scoreboard.routes.ts
注:本文中的angular-ui-router.IStateProvider类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论