import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; import { AppComponent } from './app.component'; import { HomeComponent } from './home.component'; import { PageNotFoundComponent } from './pageNotFound.component' {{#each collections}} {{#if view}} import { {{name}}Form } from './{{name}}.component'; {{/if}} {{/each}} @NgModule({ imports: [ BrowserModule, FormsModule, RouterModule.forRoot([ { path: "home", component: HomeComponent}, { path: '', redirectTo: '/home', pathMatch: 'full' }, {{#each collections}} {{#if view}} { path: '{{name}}', component: {{name}}Form }, {{/if}} {{/each}} { path: '**', component: PageNotFoundComponent }, ]) ], declarations: [ AppComponent, HomeComponent, PageNotFoundComponent, {{#each collections}} {{#if view}} {{name}}Form{{#if @last}}{{else}}, {{/if}} {{/if}} {{/each}} ], bootstrap: [ AppComponent ] }) export class AppModule { }