When working on my code, I found that I like to pass two arguments to the function specified inside the ng-click attribute.
<div class="shout" ng-repeat="user in users">
<p>{{user.name}}</p>
<img src="media/images/delete.png" ng-click="deleteUser({{$index}},{{user._id}})"/>
</div>
And in the controller:
function deleteUser(index, userId){...}
The parameter 'index' is used to remove the user from $scope.user and 'userId' is used to remove it from the mongodb. I am a newbie to AngularJS.
When I tried implementing this, the deleteUser function was not being called. It works fine when I pass a single argument, but not when passing more than one.