Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
"Can't bind to 'ngModel' since it isn't a known property of 'input'." error trying use ngModel

I would like to use ngModel in my form in Angular. So I created two inputs:

<form class="form" action="#" method="post" onsubmit="#" autocomplete="on">
    <div class="form__container">
        <div class="input__container">
            <input class="input" type="text" autofocus placeholder="E-mail address or phone number" [(ngModel)]="login">
        </div>
        <div class="input__container">
            <input class="input" type="password" placeholder="Password" [(ngModel)]="password">
        </div>

    </div>
</form>

And code in class:

export class LoginFormComponent implements OnInit {
  login:string='';
  password:string='';

  constructor() { }

  ngOnInit(): void {
  }

}

When I try to do two-way binding I am getting an error: Can't bind to 'ngModel' since it isn't a known property of 'input'.
<input class="input" type="password" placeholder="Password" [(ngModel)]="password">

And also I got next error: Type 'Event' is not assignable to type 'string'. <input class="input" type="password" placeholder="Password" [(ngModel)]="password">

Why it happened? Thank you for any help.

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!