Hello to every one, Im generating inputs fields names from a json file, I 
want dynamics fields, but I cant assign a value to [(ngModel)]

I have this error 

Uncaught Error: Cannot assign to a reference or variable!
    at _AstToIrVisitor.push../node_modules/@angular/compiler/fesm5/compiler.
js._AstToIrVisitor.visitPropertyWrite (compiler.js:15702)
    at PropertyWrite.push../node_modules/@angular/compiler/fesm5/compiler.js
.PropertyWrite.visit (compiler.js:2833)


This is my code

        <div *ngFor="let input of inputs.metadatas">
         <mat-form-field class="mat_form_width">
           <input matInput placeholder="{{input | titlecase}}" [(ngModel)]=
"input" name="input">
         </mat-form-field>
       </div>

{
  "metadatas": [
    "rut",
    "name"
  ]
}


If I delete ngModel, placeholder and name has the right values for every 
input, If I test using hard coded value to ngModel, works



-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to