Search Posts

Author: Andreea

ng-click on img not working inside ng-repeat

In my view I have a list of icons that when clicked, should call a function from the controller. View <div ng-controller=”EditorController” class=”main-div”> <aside> <div ng-repeat=”icon in EditorIcons”> <img ng-click=”changeme()” data-ng-src=”{{icon.source}}” alt=”{{}}”/> </div> </aside> </div> Controller app.controller(‘EditorController’, function($scope) { $scope.EditorIcons = [ … ]; $scope.changeme = function() { console.log(“changing”); } } I’ve seen this question asked before, yet I still wasn’t able to find out the problem here. What am I doing wrong? UPDATE I’ve […]