constructor()内需要怎么写,才能把值显示在入力框内
constructor()内需要怎么写,才能把值显示在入力框内
可是使用NgControlGroup分组后,输入框里的值就不显示了?
template:`
<div>
<ul [ngFormModel]="controls">
<li>姓名:<input type="text" ngControl="name"></li>
</ul>
<ul [ngControlGroup]="contact">
<li>地址:<input type="text" ngControl="address"></li>
<li>电话:<input type="text" ngControl="telephone"></li>
</ul>
</div>
<pre>{{dump()}}</pre>
`
constructor(){
this.controls = new ControlGroup({
name : new Control("Jason"),
contact: new ControlGroup({
address : new Control("London U.K."),
telephone : new Control("114")
})
});
}