AngularJS get element attributes values : We often need to add and get the custom attributes in elements. In AngularJs It’s different to get the attributes than the jQuery. Here In tutorial we are going to explain how to get custom attribute’s value in AngularJs.
AngularJS get element attributes values
You can get custom attributes as below. Here is an example –
Example : AngularJS get element attributes values
<div ng-app="myApp"> <div ng-controller="myController"> <button type="button" data-id="101" ng-click="getCustomAttr($element.target)">Get Attribute</button> </div> </div> |