javascript - How to add json value inside ng-model in angular -


<div data-ng-repeat="credentialsdata in credentialsdatas">     <div data-inline-validate data-error="{{ credentialsdata.key }}">     <label>{{ credentialsdata.key }}<i class="text-error">*</i></label>     <input type="text" data-ng-model="datasource.{{ credentialsdata.key }}" placeholder="{{ credentialsdata.key }}" />     </div> </div> 

but here throwing error

 data-ng-model="datasource.{{ credentialsdata.key }}" 

you don't need use binding in case, try javascript bracket notation syntax:

data-ng-model="datasource[credentialsdata.key]" 

Comments

Popular posts from this blog

javascript - How to name a jQuery function to make a browser's back button work? -

python - Django-easy-pdf: xhtml2pdf reporting reportlab 2.2+ is required, but 3.0 installed -

collision detection - C++ library for mesh to mesh intersection: what is available? -