feat(core): allow to add precompiled tokens via a provider
Introduces the new `ANALYZE_FOR_PRECOMPILE` token. This token can be used to create a virtual provider that will populate the `precompile` fields of components and app modules based on its `useValue`. All components that are referenced in the `useValue` value (either directly or in a nested array or map) will be added to the `precompile` property. closes #9874 related to #9726
This commit is contained in:
@ -11,13 +11,16 @@ import {BrowserModule} from '@angular/platform-browser';
|
||||
|
||||
import {AnimateCmp} from './animate';
|
||||
import {BasicComp} from './basic';
|
||||
import {CompWithPrecompile} from './precompile';
|
||||
import {CompWithAnalyzePrecompileProvider, CompWithPrecompile} from './precompile';
|
||||
import {ProjectingComp} from './projection';
|
||||
import {CompWithChildQuery} from './queries';
|
||||
|
||||
@AppModule({
|
||||
modules: [BrowserModule],
|
||||
precompile: [AnimateCmp, BasicComp, CompWithPrecompile, ProjectingComp, CompWithChildQuery]
|
||||
precompile: [
|
||||
AnimateCmp, BasicComp, CompWithPrecompile, CompWithAnalyzePrecompileProvider, ProjectingComp,
|
||||
CompWithChildQuery
|
||||
]
|
||||
})
|
||||
export class MainModule {
|
||||
constructor(public appRef: ApplicationRef) {}
|
||||
|
Reference in New Issue
Block a user