Issue
My problem is error with message: Can't bind to 'ngIf' since it isn't a known property of 'form'.
app.module.ts
@NgModule({
declarations: [
AppComponent,
HomeComponent,
UsersComponent,
BackButtonComponent,
BooksComponent,
NewBookComponent
],
imports: [
BrowserModule.withServerTransition({ appId: 'serverApp' }),
AppRoutingModule,
RouterModule,
HttpClientModule,
FormsModule,
ReactiveFormsModule,
CommonModule,
],
providers: [],
bootstrap: [AppComponent]
})
new-user.component.html
<form [formGroup]="entityForm" *ngIf="entityForm">
</form>
new-user.component.ts
entity: User = new User();
entityForm: FormGroup;
Solution
add your new-user component to the NgModule declarations
Answered By - HibaHasan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.