javascript - Angular.js - ng-model overwrite my ng-value on text-input -
i'll start off mentioning i'm new angular i'm not doing things in right "angular way".
i have next ng-repeat looping through info - right info beingness returned.
<tr ng-repeat="attribute in attributecategory.attributes"> <td> {{attribute.name}} </td> <td> <input type="checkbox" ng-model="attr.enabled" ng-checked="{{attribute.parameters.enabled}}" ng-change="updateattribute(attr, {{attribute.attribute_id}})"/> </td> <td> <input type="checkbox" ng-model="attr.normalise" ng-checked="{{attribute.parameters.normalise}}" ng-change="updateattribute(attr, {{attribute.attribute_id}})"/> </td> <td> <input type="checkbox" ng-model="attr.reverse" ng-checked="{{attribute.parameters.reverse}}" ng-change="updateattribute(attr, {{attribute.attribute_id}})"/> </td> <td> <input type="text" ng-model="attr.min_threshold" ng-value="{{attribute.parameters.min_threshold}}" ng-change="updateattribute(attr, {{attribute.attribute_id}})"/> </td> <td> <input type="text" ng-model="attr.max_threshold" ng-value="{{attribute.parameters.max_threshold}}" ng-change="updateattribute(attr, {{attribute.attribute_id}})"/> </td> <tr> for reason ng-value on input="text" fields doesn't show. need pass through info field in updateattribute() function, why i'm binding model attr variable i'm passing through. variable beingness used api call.
if take model off text fields have right values, need of getting value , passing through function.
if there way should doing please allow me know :)
ng-value not ment intput[text]
binds given look value of input[select] or input[radio], when element selected, ngmodel of element set bound value.
see docs
additionally ng-change expects look not have utilize {{}}
use instead
ng-change="updateattribute(attr,attribute)" javascript angularjs angularjs-scope angular-ngmodel
No comments:
Post a Comment