fix(ivy): properly inject all special token types (#24862)
Previously ngtsc had a few bugs handling special token types: * Injector was not properly translated to INJECTOR * ChangeDetectorRef was not injected via injectChangeDetectorRef() This commit fixes these two bugs, and also adds a test to ensure they continue to work correctly. PR Close #24862
This commit is contained in:

committed by
Victor Berchet

parent
53a16006d6
commit
f9a6a175bf
@ -53,6 +53,9 @@ export function getConstructorDependencies(
|
||||
const importedSymbol = reflector.getImportOfIdentifier(tokenExpr);
|
||||
if (importedSymbol !== null && importedSymbol.from === '@angular/core') {
|
||||
switch (importedSymbol.name) {
|
||||
case 'ChangeDetectorRef':
|
||||
resolved = R3ResolvedDependencyType.ChangeDetectorRef;
|
||||
break;
|
||||
case 'ElementRef':
|
||||
resolved = R3ResolvedDependencyType.ElementRef;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user