Loading...
「ツール」は右上に移動しました。
利用したサーバー: wtserver1
0いいね 45 views回再生

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

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";
}

コメント