ng-click not working in dynamically created content

you need to add $compile service here, that will bind the angular directives like ng-click to your controller scope.Something like:

var divTemplate="..your div template";
var temp = $compile(divTemplate)($scope); 

Then append it to the HTML:

angular.element(document.getElementById('foo')).append(temp);

You can also bind the event to the div as following:

 var div = angular.element("divID");
 div.bind('click', $scope.addPhoto());

Leave a Comment