angularjs - How to set attributes dynamically using Angular? -


the problem is: receive json server, contains inputs description, like: {"name":"audio bitrate","description":"","type":"int","value":"128","validators":{"between":{"class":"zend\\validator\\between","parameters":{"min":"30","max":"500","inclusive":"1"}}}}.

in ng-repeat go through json , create custom inputs (name, type, defaul value). inputs have validators, rewritten in angular derictives check inputs before sending. in case need add between derictive name, min="30", max="500" , inclusive="1" input attributes, i.e.

<input between type="number" class="form-control input-sm" placeholder="{{value.description|translate}}" ng-model="preset.parameters.common[parameter]" ng-init="preset.parameters.common[parameter] = (value.value - 0)" min="30" max="500" inclusive="1">

different inputs might have different validators or none of them (no ng-attr-* , c-class directives), did try bind attributes {{value.key}}, doesn't work.

how can achieve goal of dynamic attribute binding? thank you.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -