feat(compiler): mark @NgModules in provider lists for identification at runtime (#22005)
All of the providers in a module get compiled into a module definition in the factory file. Some of these providers are for the actual module types, as those are available for injection in Angular. For tree-shakeable tokens, the runtime needs to be able to distinguish which modules are present in an injector. This change adds a NodeFlag which tags those module providers for later identification. PR Close #22005
This commit is contained in:

committed by
Miško Hevery

parent
647b8595d0
commit
2d5e7d1b52
@ -192,7 +192,8 @@ export class ProviderAst implements TemplateAst {
|
||||
constructor(
|
||||
public token: CompileTokenMetadata, public multiProvider: boolean, public eager: boolean,
|
||||
public providers: CompileProviderMetadata[], public providerType: ProviderAstType,
|
||||
public lifecycleHooks: LifecycleHooks[], public sourceSpan: ParseSourceSpan) {}
|
||||
public lifecycleHooks: LifecycleHooks[], public sourceSpan: ParseSourceSpan,
|
||||
readonly isModule: boolean) {}
|
||||
|
||||
visit(visitor: TemplateAstVisitor, context: any): any {
|
||||
// No visit method in the visitor for now...
|
||||
|
Reference in New Issue
Block a user