mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
AngularJS: IRoute has been union typed
This commit is contained in:
@@ -10,16 +10,27 @@ declare var $routeProvider: ng.route.IRouteProvider;
|
||||
$routeProvider
|
||||
.when('/projects/:projectId/dashboard', {
|
||||
controller: 'I am a string',
|
||||
templateUrl: '',
|
||||
templateUrl: "So am I",
|
||||
caseInsensitiveMatch: true,
|
||||
reloadOnSearch: false
|
||||
})
|
||||
.when('/projects/:projectId/dashboard', {
|
||||
controller: function() {
|
||||
.when('/projects/:projectId/dashboard2', {
|
||||
controller: function () {
|
||||
//Look at me - I'm a function!
|
||||
},
|
||||
templateUrl: '',
|
||||
caseInsensitiveMatch: true,
|
||||
reloadOnSearch: false
|
||||
template: function ($routeParams?: ng.route.IRouteParamsService) {
|
||||
return "I return a string"
|
||||
}
|
||||
})
|
||||
.otherwise({redirectTo: '/'});
|
||||
.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"
|
||||
}
|
||||
})
|
||||
.otherwise({ redirectTo: '/' })
|
||||
.otherwise({ redirectTo: ($routeParams?: ng.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) => "" });
|
||||
|
||||
Reference in New Issue
Block a user