Angular4 Exception: Can’t bind to ‘ngClass’ since it isn’t a known property of ‘input’

Since RegisterComponent was declared in RegisterRouter(what’s the name for module?) module then you have to import CommonModule there:

@NgModule({
  imports: [
    RouterModule.forChild(routes),
    FormsModule,
    ReactiveFormsModule,
    CommonModule      <================== this line
  ],
  declarations: [
    RegisterComponent // this component wants to have access to built-in directives
  ],
  exports: [RouterModule]
})
export class RegisterRouter { }

Leave a Comment