Skip to content

Commit

Permalink
#405 don't try to resolve ng2Injector if token is provided by `ng1I…
Browse files Browse the repository at this point in the history
…njector`
  • Loading branch information
Eugene Gusarov authored and christopherthielen committed Jul 21, 2020
1 parent 03bdc26 commit 0bbf4cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/angular-hybrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ upgradeModule.run([
// it retrieves from ng1 injector first, then ng2 injector if the token isn't found.
const mergedInjector = {
get: function(token: any, ng2NotFoundValue?: any) {
const ng2Injector = ng1Injector.get('$$angularInjector');
if (ng1Injector.has(token)) {
return ng1Injector.get(token);
}
const ng2Injector = ng1Injector.get('$$angularInjector');
return ng2Injector.get(token, ng2NotFoundValue);
},
};
Expand Down

0 comments on commit 0bbf4cf

Please sign in to comment.