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());
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…