Issue
I'm working on an Ionic Angular 7 project and I'm trying to use reactive forms in my application. As app.module.ts is removed from Ionic Angular 7, I tried to check through few articles found on Internet. However, when I try to import the ReactiveFormsModule in my main.ts file as mentioned in those articles, it didn't work.
Sample of code from main.ts after importing ReactiveFormsModule:
bootstrapApplication(AppComponent, {
providers: [
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
importProvidersFrom(IonicModule.forRoot({}),ReactiveFormsModule),
provideRouter(routes),
],
});
I'm not sure how to proceed with using reactive forms in my Ionic Angular 7 project. How can I add the ReactiveFormsModule to my project and use reactive forms?
Solution
You need to import it in the component it's being used in:
@Component({
standalone:true,
imports: [ReactiveFormsModule]
})
Answered By - StackoverBlows
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.