Can not bind to 'ngModel' since it is not a known property of 'input'

1

I am with [(ngModel)]="cliente.nome" this code is generating the error of:

Can't bind to 'ngModel' since it isn't a known property of 'input'. ("="col-md-4 control-label" for="idNome">Nome: </label>

And I already put the FormModule in the app.module.ts , but even as the error persists, it follows the structure of the project:
app.module.ts:

 import { FormsModule }   from '@angular/forms';
   @NgModule({
  declarations: [ AppComponent], 
  imports: [
   ...
    FormsModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {}

app-routing.module.ts:

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

const routes: Routes = [];

@NgModule({
  imports: [RouterModule.forRoot(routes), ],
  exports: [RouterModule]
})
export class AppRoutingModule { }

the attendance.module.ts:

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { AtendimentoRoutingModule } from './atendimento-routing.module';
import { AtendimentoComponent } from './atendimento/atendimento.component';

@NgModule({
  imports: [
    CommonModule,
    AtendimentoRoutingModule
  ],
  declarations: [AtendimentoComponent]
})
export class AtendimentoModule { }

And thecompany.component.ts:

 import { Component, OnInit } from '@angular/core';
import { AtendimentoService } from '../atendimento.service';

import { Cliente } from '../../cliente/Cliente'
@Component({
  selector: 'app-atendimento',
  templateUrl: './atendimento.component.html',
  styleUrls: ['./atendimento.component.css'],
  providers: [AtendimentoService, Cliente]
})
export class AtendimentoComponent implements OnInit {
    
asked by anonymous 02.12.2017 / 22:44

1 answer

3

I found the error in my code, I just added the

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

Inside my help.module.ts, so import {NgModule} from

 '@angular/core';
    import { CommonModule } from '@angular/common';
    import { FormsModule }   from '@angular/forms';  // Adicionei aqui
    import { AtendimentoRoutingModule } from './atendimento-routing.module';
    import { AtendimentoComponent } from './atendimento/atendimento.component';

    @NgModule({
      imports: [
        CommonModule,
        AtendimentoRoutingModule,
        FormsModule // Adicionei aqui
      ],
      declarations: [AtendimentoComponent]
    })
    export class AtendimentoModule { }
    
03.12.2017 / 04:12