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
Post a Comment