Skip to content

Commit

Permalink
fix($route): support inline annotation on .resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
mhevery committed Sep 12, 2012
1 parent 209b67d commit b0a05a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/ng/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
8 changes: 4 additions & 4 deletions test/ng/routeSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
} });
});
Expand Down Expand Up @@ -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'});
Expand Down

0 comments on commit b0a05a7

Please sign in to comment.