ialexivy / vscode-angular2-files

vscode extension generating angular files with angular cli
MIT License
61 stars 36 forks source link

app.module.ts Modified Incorrectly when it contains RouterModule.forRoot #38

Closed jeff-a-andersen closed 6 years ago

jeff-a-andersen commented 6 years ago

If I add a new component using the "Generate Component" context menu and my app.module.ts file contains the following imports:

imports: [RouterModule.forRoot(appRoutes)],

the new component gets added incorrectly and the syntax is messed up. It doesn't matter if I have additional imports or the order of the imports, any time that I generate a component the app.module.ts file gets clobbered.

Attached is a copy of my app.module.ts file before and after adding a new component. It appears that an additional "]}" is getting added that causes the issue.

Thanks

before-app.module.ts.txt after-app.module.ts.txt