mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +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) {
|
||||
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'});
|
||||
|
|
|
|||
Loading…
Reference in a new issue