I am attempting to dynamically generate the ng-model
directive within an ng-repeat
, but I am encountering a browser error. Our goal is to dynamically retrieve attributes of a certain type and set them in the DOM.
The specific error I am receiving is:
Error: [$parse:syntax] Syntax Error: Token '{' invalid key at column 2 of the expression [{{'attribute.'+attribute.label}}] starting at [{'attribute.'+attribute.label}}].
You can view the error details here
<div class="form-group" ng-repeat="attribute in objectType.objectAttributes | orderBy : attribute.order">
<div class="col-sm-10" ng-if="attribute.multivalued==false">
<input type="{{attribute.type}}" class="form-control"
ng-model="{{'attribute.'+attribute.label}}">
</div>
</div>
Does anyone have any suggestions on how to resolve this issue? Thank you!