Skip to content

Commit 0bbf4cf

Browse files
Eugene Gusarovchristopherthielen
authored andcommitted
#405 don't try to resolve ng2Injector if token is provided by ng1Injector
1 parent 03bdc26 commit 0bbf4cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/angular-hybrid.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,10 @@ upgradeModule.run([
247247
// it retrieves from ng1 injector first, then ng2 injector if the token isn't found.
248248
const mergedInjector = {
249249
get: function(token: any, ng2NotFoundValue?: any) {
250-
const ng2Injector = ng1Injector.get('$$angularInjector');
251250
if (ng1Injector.has(token)) {
252251
return ng1Injector.get(token);
253252
}
253+
const ng2Injector = ng1Injector.get('$$angularInjector');
254254
return ng2Injector.get(token, ng2NotFoundValue);
255255
},
256256
};

0 commit comments

Comments
 (0)