Angular2: Export of RouterModule, Why it is required?

You don’t need to export it. It’s just for convenience.
If you add AppRoutingModule to AppModule you also implicitly import RouterModule this way. Otherwise you would need to import it explicitely

@NgModule({
  imports: [AppRoutingModule, RouterModule],
})
export class AppModule {}

for example to be able to use <router-outlet> or RouterLink in components declared in AppModule

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)