無法綁定到“ngModel”,因為它不是“輸入”的已知屬性我在啟動我的角度應(yīng)用程序時有以下錯誤,即使組件沒有顯示。我要評論一下<input>這樣我的應(yīng)用程序就能工作了。 zone.js:461 Unhandled Promise rejection: Template parse errors:
Can't bind to 'ngModel' since it isn't a known property of 'input'. ("
<div>
<label>Created:</label>
<input type="text" [ERROR ->][(ngModel)]="test" placeholder="foo" />
</div>
</div>"): InterventionDetails@4:28 ; Zone: <root> ; Task: Promise.then ; Value:我在看英雄柱塞,但我沒有看到與我的代碼有任何區(qū)別。以下是組件文件: 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";
}
無法綁定到“ngModel”,因為它不是“輸入”的已知屬性
FFIVE
2019-07-19 10:21:17