AngularJS: IRoute has been union typed

This commit is contained in:
johnnyreilly
2015-01-17 22:09:34 +00:00
parent 9fc7f5794c
commit 30ce45e0e7
2 changed files with 22 additions and 11 deletions
+18 -7
View File
@@ -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) => "" });