-2

Full code is:

 <input #inputSearch tabindex="0" [(ngModel)]="searchValue" (keydown.enter)="searchByClick()" type="text">

app.module is:

@NgModule({
declarations: [],
 imports: [
    CommonModule,
    SharedModule,
    BrowserModule,
    AppRoutingModule
  ]
)}
export class AppModule {}

What is wrong, why it does not work for me?

POV
  • 11,293
  • 34
  • 107
  • 201

2 Answers2

2

import { FormsModule } from '@angular/forms'; import { NgModule } from "@angular/core"; Import FormsModule & NgModule in app.module.ts

Pratik Malvi
  • 416
  • 4
  • 10
1

try this:

import { FormsModule } from '@angular/forms';

Add this module to your:

@NgModule({
declarations: [],
 imports: [
    CommonModule,
    SharedModule,
    BrowserModule,
FormsModule,
    AppRoutingModule
  ]
)}
export class AppModule {}
Doflamingo19
  • 1,591
  • 4
  • 12
  • 32