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

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

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