Reputation: 1039
The following code does not work. I've tried everything to make it work. It appears that angle 2 does not accept interpolation calling a direct variable.
@Component({
template: ` <input type="text" name="name" [(ngModel)]="name" #name="ngModel">
{{ name }}
`
})
export class ProductComponent {
private name:string = '';
}
rather than 'name' I would have to use product.name.
that's right? but why?
Upvotes: 0
Views: 33
Reputation: 214017
You have a conflict of variables
Replace #name="ngModel"
with #name2="ngModel"
Upvotes: 2