I added the ng-click icon to my icon as follows:
<img src="images/customer_icon.png" class="customer" ng-click="processForm($event)">
And here is the js file.
var app = angular.module('myapp', []); app.controller('mycontroller', function($scope) { $scope.processForm = function(obj) { var elem = angular.element(obj); alert("Current class value: " + elem.getAttribute("class")); }; });
I get the error "elem.getAttribute is not a function". Trying to switch the "class" to "ng-class", I ran into another problem: "ng-class" is not recognized by my css files.
Is there a way to get / set the "class" attribute directly?
source share