1

I am updating my project's angular version from v2.0.0-beta.6 to v4.1.1.

Normally, I update from

<input type="text" ngControl="name" .../>

to

<input type="text" #name="ngModel" .../>

It works well in my project until I met this:

<input type="text" required ngControl="{{[param.key]}}"  [(ngModel)]="params[param.key]" ... />

How can I set the attribute name variable? Thanks!

Ved Rauniyar
  • 1,539
  • 14
  • 21
deleted
  • 23
  • 3
  • I think `` should be `` – Günter Zöchbauer May 22 '17 at 08:28
  • 2
    Possible duplicate of [Angular2 binding of "name" attribute in elements with \*ngFor](http://stackoverflow.com/questions/42878385/angular2-binding-of-name-attribute-in-input-elements-with-ngfor) – Ramesh Rajendran May 22 '17 at 08:29
  • Thanks. It works well when I add `[ngModelOptions]="{standalone: true}"` in my input. Sometimes I just can't get the deep difference between `name` attribute and `[ngModelOptions]` when I used `[(ngModel)]` in my input. – deleted May 22 '17 at 12:12

0 Answers0