0
以下代码不起作用。我已经尽了一切努力使其工作。看来角度2不接受调用直接变量的插值。我在数据插值时出错
@Component({
template: ` <input type="text" name="name" [(ngModel)]="name" #name="ngModel">
{{ name }}
`
})
export class ProductComponent {
private name:string = '';
}
而不是'name'我必须使用product.name。
是吗?但为什么?
它的工作更换
#name="ngModel"
!非常感谢。 –