fix($route): support inline annotation on .resolve
This commit is contained in:
+1
-1
@@ -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)) {
|
||||
|
||||
@@ -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'});
|
||||
|
||||
Reference in New Issue
Block a user