@@ -34,34 +34,34 @@ export class Extractor {
3434 const programSymbols : StaticSymbol [ ] =
3535 extractProgramSymbols ( this . program , this . staticReflector , this . reflectorHost , this . options ) ;
3636
37- return compiler
38- . analyzeNgModules ( programSymbols , { transitiveModules : true } , this . metadataResolver )
39- . then ( ( { files} ) => {
40- const errors : compiler . ParseError [ ] = [ ] ;
41-
42- files . forEach ( file => {
43- const compMetas : compiler . CompileDirectiveMetadata [ ] = [ ] ;
44- file . directives . forEach ( directiveType => {
45- const dirMeta = this . metadataResolver . getDirectiveMetadata ( directiveType ) ;
46- if ( dirMeta && dirMeta . isComponent ) {
47- compMetas . push ( dirMeta ) ;
48- }
49- } ) ;
50- compMetas . forEach ( compMeta => {
51- const html = compMeta . template . template ;
52- const interpolationConfig =
53- compiler . InterpolationConfig . fromArray ( compMeta . template . interpolation ) ;
54- errors . push (
55- ...this . messageBundle . updateFromTemplate ( html , file . srcUrl , interpolationConfig ) ) ;
56- } ) ;
57- } ) ;
58-
59- if ( errors . length ) {
60- throw new Error ( errors . map ( e => e . toString ( ) ) . join ( '\n' ) ) ;
37+ const { ngModules, files} = compiler . analyzeAndValidateNgModules (
38+ programSymbols , { transitiveModules : true } , this . metadataResolver ) ;
39+ return compiler . loadNgModuleDirectives ( ngModules ) . then ( ( ) => {
40+ const errors : compiler . ParseError [ ] = [ ] ;
41+
42+ files . forEach ( file => {
43+ const compMetas : compiler . CompileDirectiveMetadata [ ] = [ ] ;
44+ file . directives . forEach ( directiveType => {
45+ const dirMeta = this . metadataResolver . getDirectiveMetadata ( directiveType ) ;
46+ if ( dirMeta && dirMeta . isComponent ) {
47+ compMetas . push ( dirMeta ) ;
6148 }
62-
63- return this . messageBundle ;
6449 } ) ;
50+ compMetas . forEach ( compMeta => {
51+ const html = compMeta . template . template ;
52+ const interpolationConfig =
53+ compiler . InterpolationConfig . fromArray ( compMeta . template . interpolation ) ;
54+ errors . push (
55+ ...this . messageBundle . updateFromTemplate ( html , file . srcUrl , interpolationConfig ) ) ;
56+ } ) ;
57+ } ) ;
58+
59+ if ( errors . length ) {
60+ throw new Error ( errors . map ( e => e . toString ( ) ) . join ( '\n' ) ) ;
61+ }
62+
63+ return this . messageBundle ;
64+ } ) ;
6565 }
6666
6767 static create (
0 commit comments