-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?

OPV
  • 1
  • 26
  • 81
  • 156

2 Answers2

2

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

Pratik Malvi
  • 386
  • 3
  • 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,487
  • 2
  • 10
  • 29