Angular: error NG8002: Can‘t bind to ‘ngModel‘ since it isn‘t a known property of ‘input‘.

created at 09-26-2021 views: 7

error

The above is the error content ([(ngModel)] two-way binding is invalid)

Solution: add in module.ts

import {FormsModule} from'@angular/forms';
imports: [
    FormsModule,
    ...
],

solution

So now we can use [(ngModel)] two-way binding

created at:09-26-2021
edited at: 09-26-2021: