本文整理匯總了TypeScript中angular.ILocationProvider類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ILocationProvider類的具體用法?TypeScript ILocationProvider怎麽用?TypeScript ILocationProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ILocationProvider類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: registerRoutes
export function registerRoutes($stateProvider: IStateProvider,
$urlRouterProvider: IUrlRouterProvider,
$locationProvider: ILocationProvider){
$urlRouterProvider.otherwise("/home");
$stateProvider
.state('home', {
url: "/home",
template: `<tar-home></tar-home>`
})
.state('about', {
url: "/about",
template: `<tar-about></tar-about>`
});
$locationProvider.html5Mode(true);
}
示例2: router
export function router($stateProvider:IStateProvider, $locationProvider:ILocationProvider, $urlRouterProvider:IUrlRouterProvider) {
$locationProvider.html5Mode(true);
// $locationProvider.hashPrefix('!');
$urlRouterProvider.otherwise('/');
// ACCOUNT
$stateProvider.state('login', {
url: '/login',
views: {
'master': {
templateUrl: 'tpl/account/login.html',
controller: 'loginController',
controllerAs: 'vm'
}
}
});
// The Rest
$stateProvider.state('home', {
url: '/',
views: {
'master': {
templateUrl: 'tpl/home.html',
controller: 'homeController',
controllerAs: 'vm'
}
}
});
$stateProvider.state('about', {
url: '/about',
views: {
'master': {
templateUrl: 'tpl/about.html',
controller: 'aboutController',
controllerAs: 'vm'
}
}
});
///<vesta:ngRouter/>
}
示例3: appConfigFunc
/*@ngInject*/
export default function appConfigFunc(
$logProvider: ILogProvider,
$locationProvider: ILocationProvider,
$httpProvider: IHttpProvider,
$compileProvider: ICompileProvider
) {
configureForDebug(true);
configureHttp();
// remove the hash tag
$locationProvider.html5Mode({
enabled: true
});
function configureForDebug(isDebug: boolean) {
$compileProvider.debugInfoEnabled(isDebug);
$logProvider.debugEnabled(isDebug);
}
function configureHttp() {
// http://blog.thoughtram.io/angularjs/2015/01/14/exploring-angular-1.3-speed-up-with-applyAsync.html
$httpProvider.useApplyAsync(true);
}
}
示例4:
bootstrapModule.config(($locationProvider: ILocationProvider) => {
'ngInject';
$locationProvider.hashPrefix('');
});
示例5: RoutesConfigFunc
function RoutesConfigFunc($locationProvider: ILocationProvider) {
$locationProvider.html5Mode(true);
}
示例6:
($locationProvider: ILocationProvider) => {
$locationProvider.hashPrefix('');
},