TypeScript-'s Angular Framework Error - “There is no directive with exportAs set to ngForm”

前端 未结 22 1730
轻奢々
轻奢々 2020-12-04 09:18

I keep getting this error while using TypeScript\'s Angular2-forms framework:

There is no directive with \"exportAs\" set to \"ngForm

22条回答
  •  猫巷女王i
    2020-12-04 09:30

    import { FormsModule,ReactiveFormsModule }from'@angular/forms';
    
    imports:[
        BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }),
        HttpClientModule,
        FormsModule,
        ReactiveFormsModule/*This one in particular*/,...
    ],
    

    in app.module.ts to permanently solve errors like "cannot bind [formGroup] or no directive with export as".

提交回复
热议问题