Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit b0a05a7

Browse files
committed
fix($route): support inline annotation on .resolve
1 parent 209b67d commit b0a05a7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/ng/route.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ function $RouteProvider(){
373373

374374
forEach(next.resolve || {}, function(value, key) {
375375
keys.push(key);
376-
values.push(isFunction(value) ? $injector.invoke(value) : $injector.get(value));
376+
values.push(isString(value) ? $injector.get(value) : $injector.invoke(value));
377377
});
378378
if (isDefined(template = next.template)) {
379379
} else if (isDefined(template = next.templateUrl)) {

test/ng/routeSpec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,10 @@ describe('$route', function() {
232232
return deferB.promise;
233233
});
234234
$routeProvider.when('/path', { templateUrl: 'foo.html', resolve: {
235-
a: function($q) {
235+
a: ['$q', function($q) {
236236
deferA = $q.defer();
237237
return deferA.promise;
238-
},
238+
}],
239239
b: 'b'
240240
} });
241241
});
@@ -434,8 +434,8 @@ describe('$route', function() {
434434
});
435435
});
436436
});
437-
438-
437+
438+
439439
it('should match route with and without trailing slash', function() {
440440
module(function($routeProvider){
441441
$routeProvider.when('/foo', {templateUrl: 'foo.html'});

0 commit comments

Comments
 (0)