DefinitelyTyped/angular-route/angular-route-tests.ts
Mohamed Hegazy 4e78cb2edd Angular sub packages (#10170)
* move angular-animate.d.ts to its own folder

* Make angular-animate a module, and use module augmentation to update the angular module

* Move angular-cookies.d.ts to its own folder

* Make angular-cookies a module, and use module augmentation to update the angular module

* Remove outdated readme

* Move angular-mocks.d.ts to its own folder

* Make angular-mocks a module, and use module augmentation to update the angular module

* Move angular-resource.d.ts to its own folder

* Make angular-resource a module, and use module augmentation to update the angular module

* Move angular-route.d.ts to its own folder

* Make angular-route a module, and use module augmentation to update the angular module

* Move angular-santize.d.ts to its own folder

* Make angular-sanitize a module, and use module augmentation to update the angular module
2016-07-18 15:36:53 -07:00

48 lines
1.5 KiB
TypeScript

/**
* @license HTTP Auth Interceptor Module for AngularJS
* (c) 2013 Jonathan Park @ Daptiv Solutions Inc
* License: MIT
*/
declare var $routeProvider: ng.route.IRouteProvider;
$routeProvider
.when('/projects/:projectId/dashboard', {
controller: 'I am a string',
templateUrl: "So am I",
caseInsensitiveMatch: true,
reloadOnSearch: false
})
.when('/projects/:projectId/dashboard2', {
controller: function () {
//Look at me - I'm a function!
},
template: function ($routeParams?: ng.route.IRouteParamsService) {
return "I return a string"
}
})
.when('/projects/:projectId/dashboard3', {
controllerAs: 'I am a string',
template: "Yup. String"
})
.when('/projects/:projectId/dashboard4', {
controller: 'I am a string',
templateUrl: function ($routeParams?: ng.route.IRouteParamsService) {
return "I return a string"
}
})
.when('/projects/:projectId/dashboard5', {
controller: ['$log',function($log:ng.ILogService){
$log.info('I am array')
}],
templateUrl: function ($routeParams?: ng.route.IRouteParamsService) {
return "I return a string"
}
})
.otherwise({ redirectTo: '/' })
.otherwise({ redirectTo: ($routeParams?: ng.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) => "" });
var current: ng.route.ICurrentRoute;
current.locals['test-key'] = 'test-value';