本文整理汇总了TypeScript中@uirouter/angularjs.StateProvider类的典型用法代码示例。如果您正苦于以下问题:TypeScript StateProvider类的具体用法?TypeScript StateProvider怎么用?TypeScript StateProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StateProvider类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
.config(($stateProvider: StateProvider) => {
'ngInject';
$stateProvider.state({
name: 'destiny2.vendors',
component: 'd2Vendors',
url: '/vendors?characterId'
});
$stateProvider.state({
name: 'destiny2.vendor',
component: 'd2SingleVendor',
url: '/vendors/:id?characterId'
});
})
示例2:
.config(($stateProvider: StateProvider) => {
'ngInject';
$stateProvider.state({
name: 'destiny2.progress',
component: 'd2Progress',
url: '/progress'
});
})
示例3: configFn
configFn($stateProvider:StateProvider) {
$stateProvider.state('jcr-query',{
url:'/admin/jcr-query',
views: {
'content': {
//templateUrl: 'js/admin/jcr/jcr-query.html',
component:"jcrQueryController",
//controllerAs:"vm"
}
},
resolve: {
loadMyCtrl: this.lazyLoadController(['admin/jcr/JcrQueryController'])
},
data:{
breadcrumbRoot:false,
displayName:'JCR Admin',
module:moduleName,
permissions:AccessConstants.UI_STATES.JCR_ADMIN.permissions
}
});
$stateProvider.state('cluster',{
url:'/admin/cluster',
views: {
'content': {
// templateUrl: 'js/admin/cluster/cluster-test.html',
component:"clusterController",
//controllerAs:"vm"
}
},
resolve: {
loadMyCtrl: this.lazyLoadController(['admin/cluster/ClusterController'])
},
data:{
breadcrumbRoot:false,
displayName:'Kylo Cluster',
module:moduleName,
permissions:[]
}
})
}
示例4:
.config(($stateProvider: StateProvider) => {
'ngInject';
$stateProvider.state({
name: 'login',
url: '/login',
component: 'login',
params: {
reauth: false
}
});
})
示例5: destinyAccountRoute
export function destinyAccountRoute($stateProvider: StateProvider) {
'ngInject';
$stateProvider.state({
name: 'destiny-account',
redirectTo: 'destiny2.inventory',
url: '/:membershipId-{platformType:int}'
});
// Register a lazy future state for all Destiny 1 pages, so they are not in the main chunk.
$stateProvider.state({
name: 'destiny1.**',
parent: 'destiny-account',
lazyLoad($transition$) {
const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad');
// tslint:disable-next-line:space-in-parens
return import(/* webpackChunkName: "destiny1" */ '../destiny1/destiny1.module.js')
.then((mod) => $ocLazyLoad.load(mod.default));
}
});
}
示例6: routes
function routes(
$stateProvider: StateProvider,
$urlRouterProvider: UrlRouterProvider,
$locationProvider: LocationConfig
) {
$locationProvider.hashPrefix('');
$stateProvider.state('about', {
url: '/about',
component: 'ltAbout'
});
const params = [
'files',
'user',
'userLimit',
'userStart',
'userEnd',
'category',
'categoryDepth'
].join('&');
$stateProvider.state('select', {
url: '/?' + params,
component: 'ltFilesSelector'
});
$stateProvider.state('geolocate', {
url: '/geolocate?' + params,
component: 'ltMain'
});
$stateProvider.state('map', {
url: '/map?' + params,
component: 'ltAllMap'
});
$urlRouterProvider.otherwise('/');
}
示例7: configFn
configFn($stateProvider:StateProvider, $compileProvider: angular.ICompileProvider) {
$stateProvider.state(AccessConstants.UI_STATES.ALERTS.state,{
url:'/alerts',
views: {
'content': {
// templateUrl: 'js/ops-mgr/alerts/alerts-table.html',
component:'alertsController',
//controllerAs:'vm'
}
},
params: {
query: null
},
resolve: {
loadPage: this.lazyLoad()
},
data:{
displayName:'Alerts',
module:moduleName,
permissions:AccessConstants.UI_STATES.ALERTS.permissions
}
}).state(AccessConstants.UI_STATES.ALERT_DETAILS.state,{
url:"/alert-details/{alertId}",
views: {
'content': {
//templateUrl: 'js/ops-mgr/alerts/alert-details.html',
component:'alertDetailsController',
//controllerAs:'vm'
}
},
params: {
alertId: null
},
resolve: {
loadMyCtrl: this.lazyLoadController(['ops-mgr/alerts/AlertDetailsController'])
},
data:{
displayName:'Alert Details',
module:moduleName,
permissions:AccessConstants.UI_STATES.ALERT_DETAILS.permissions
}
});
}
示例8: defaultAccountRoute
export function defaultAccountRoute($stateProvider: StateProvider) {
'ngInject';
// A dummy state that'll redirect to the selected character's Destiny 1 inventory
$stateProvider.state({
name: 'default-account',
resolve: {
activeAccount: () => {
'ngInject';
return getPlatforms().then(getActivePlatform);
}
},
controller: function controller($state, activeAccount) {
'ngInject';
if (activeAccount) {
$state.go(`destiny${activeAccount.destinyVersion}.inventory`, activeAccount);
} else {
// A bit awkward, but getPlatforms should already have redirected to login
}
}
});
}