1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Can't bind to 'ngModel' since it isn't a known property of 'input'

Discussão em 'Angular' iniciado por Anthony Brenelière, Setembro 10, 2024.

  1. I have this simple input in my component which uses [(ngModel)] :

    <input type="text" [(ngModel)]="test" placeholder="foo" />


    And I get the following error when I launch my app, even if the component is not displayed.


    zone.js:461 Unhandled Promise rejection: Template parse errors: Can't bind to 'ngModel' since it isn't a known property of 'input'.

    Here is the component.ts:

    import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
    import { Intervention } from '../../model/intervention';

    @Component({
    selector: 'intervention-details',
    templateUrl: 'app/intervention/details/intervention.details.html',
    styleUrls: ['app/intervention/details/intervention.details.css']
    })

    export class InterventionDetails
    {
    @Input() intervention: Intervention;

    public test : string = "toto";
    }

    Continue reading...

Compartilhe esta Página