I'm trying to use ng-click to call a function in my controller, but I haven't been able to get that to work. I've stripped everything down to its simplest form, so that I now have this:
<button id="submitBtn" type="submit" class="btn btn-default"
ng-click="count = count + 1; count = count + 2; alert('hello');" >Submit</button>
The first two statements (count = count + 1; count = count + 2;) execute just fine, but it won't call the alert function. When I take out the two count incrementing statements, the alert still won't work. Anytime I try to call a function, it fails, but plain old Javascript works.
(Just an FYI, I have Javascript down the page that prevents the form from submitting and triggering a postback).
Edit:
I'll include my controller's code for this:
myApp.controller('LawSearchController', ['$scope', function ($scope) {
$scope.alert = function (text) {
alert(text);
};
}]);