@@ -141,7 +141,7 @@ export class SampleAssetsGenerator {
141141 this._shortenComponentPath(config, appModuleFile);
142142 sampleFiles.push(appModuleFile);
143143 */
144- this . _modifyImports ( sampleFiles . filter ( x => x . fileExtension === 'ts' && x . isMain ) , additionalFiles ) ;
144+ this . _modifyImports ( sampleFiles . filter ( x => x . fileExtension === 'ts' || x . path . endsWith ( '.ts' ) ) , additionalFiles ) ;
145145 sampleFiles . push ( new LiveEditingFile (
146146 SAMPLE_APP_FOLDER + "app.component.ts" ,
147147 this . _getAppComponentTs ( config , sampleFiles )
@@ -316,14 +316,11 @@ export class SampleAssetsGenerator {
316316 }
317317 if ( appConfig . providers && appConfig . providers . length ) {
318318 appConfig . providers . forEach ( provider => {
319+ const importName = provider . provider . replace ( / \( .* \) $ / g, "" ) ;
319320 if ( importMap . has ( provider . import ) ) {
320- importMap . get ( provider . import ) . push (
321- provider . provider . replace ( / \( / g, "" ) . replace ( / \) / g, "" )
322- ) ;
321+ importMap . get ( provider . import ) . push ( importName ) ;
323322 } else {
324- importMap . set ( provider . import , [
325- provider . provider . replace ( / \( / g, "" ) . replace ( / \) / g, "" )
326- ] ) ;
323+ importMap . set ( provider . import , [ importName ] ) ;
327324 }
328325 } ) ;
329326 }
0 commit comments