javascript - Get custom HTML attribute value from controller -


i have added custom attribute (cust-property) html input control,

<input name="myinputname" type="text" ng-model="mymodel" cust-property="my value"> 

now i'm trying value of custom defined attribute validation error object list

for (var in $scope.form.$error.required) {     var elementname = $scope.form.$error.required[i].$name;     //var custompropertyvalue = $scope.form.$error.required[i].cust-property; } 

how can custom html attribute value controller?

try this:

var id = $scope.form.$error.required[i].attributes['cust-property'].value; 

but should try on directive.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -