本文整理汇总了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('');
},