fix($route): support inline annotation on .resolve

This commit is contained in:
Misko Hevery
2012-09-11 22:10:26 -07:00
parent e191582a02
commit 074a354fa9
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -373,7 +373,7 @@ function $RouteProvider(){
forEach(next.resolve || {}, function(value, key) {
keys.push(key);
values.push(isFunction(value) ? $injector.invoke(value) : $injector.get(value));
values.push(isString(value) ? $injector.get(value) : $injector.invoke(value));
});
if (isDefined(template = next.template)) {
} else if (isDefined(template = next.templateUrl)) {
+4 -4
View File
@@ -232,10 +232,10 @@ describe('$route', function() {
return deferB.promise;
});
$routeProvider.when('/path', { templateUrl: 'foo.html', resolve: {
a: function($q) {
a: ['$q', function($q) {
deferA = $q.defer();
return deferA.promise;
},
}],
b: 'b'
} });
});
@@ -434,8 +434,8 @@ describe('$route', function() {
});
});
});
it('should match route with and without trailing slash', function() {
module(function($routeProvider){
$routeProvider.when('/foo', {templateUrl: 'foo.html'});