无法绑定到“ngModel”,因为它不是“输入”的已知属性我在启动我的角度应用程序时有以下错误,即使组件没有显示。我要评论一下<input>这样我的应用程序就能工作了。 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:我在看英雄柱塞,但我没有看到与我的代码有任何区别。以下是组件文件: 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";
}
添加回答
举报
0/150
提交
取消