mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-16 02:33:09 +00:00
fix($route): support inline annotation on .resolve
This commit is contained in:
parent
209b67df6a
commit
b0a05a7531
2 changed files with 5 additions and 5 deletions
|
|
@ -373,7 +373,7 @@ function $RouteProvider(){
|
||||||
|
|
||||||
forEach(next.resolve || {}, function(value, key) {
|
forEach(next.resolve || {}, function(value, key) {
|
||||||
keys.push(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)) {
|
if (isDefined(template = next.template)) {
|
||||||
} else if (isDefined(template = next.templateUrl)) {
|
} else if (isDefined(template = next.templateUrl)) {
|
||||||
|
|
|
||||||
|
|
@ -232,10 +232,10 @@ describe('$route', function() {
|
||||||
return deferB.promise;
|
return deferB.promise;
|
||||||
});
|
});
|
||||||
$routeProvider.when('/path', { templateUrl: 'foo.html', resolve: {
|
$routeProvider.when('/path', { templateUrl: 'foo.html', resolve: {
|
||||||
a: function($q) {
|
a: ['$q', function($q) {
|
||||||
deferA = $q.defer();
|
deferA = $q.defer();
|
||||||
return deferA.promise;
|
return deferA.promise;
|
||||||
},
|
}],
|
||||||
b: 'b'
|
b: 'b'
|
||||||
} });
|
} });
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue