Closed Feargalicious closed 4 years ago
+1
This still happens in 1.6.2. The correct component is being imported and added to the declarations in NgModule but the RouterModule breaks, with my version looking like:
imports: [
RouterModule.forRoot([\n\t\t\tpath
],
Fixed
When adding a new component, the import section of NgModule gets deleted and a \n seems to be added.
imports: [ RouterModule.forRoot([ { path: '', component: HomeComponent, pathMatch: 'full' }, { path: 'home', component: HomeComponent }, { path: 'admin', component: AdminComponent }, { path: 'queue', component: QueueComponent }, ]), BrowserModule, BrowserAnimationsModule, HttpClientModule, MaterialModule, FormsModule, ReactiveFormsModule, ]
Turns into
imports: [ RouterModule.forRoot([\npath ]
app.module.ts-before.txt app.module.ts-after.txt