I have a issues with buttons calling $scope methods, and I’d love any insight or ideas on this.
The problem is that button elements like this do not call the $scope method:
<button class="button" type="button" ng-click="testMe();">
I can create a new app, as shown by this codepen, where this works just fine: http://codepen.io/davidfrahm/pen/GgaWXL
However, I have a real world app that has been around awhile, and after upgrading from 1.0.0-rc.1-nightly-1155 to 1.0.0-rc.2, I start having issues with these simple buttons.
<button class="button" type="button" ng-click="testMe();">
button with class is broken
</button>
<button type="button" ng-click="testMe();">
button no class works
</button>
<a class="button" ng-click="testMe();">
anchor with class works
</a>
In the example above, this is the only code inside my , and the controller only has the testMe function in it, just like the codepen above:
.controller('MyCtrl', function($scope) {
$scope.testMe = function () {
alert("testMe()");
};
});
I’m not sure how to debug this any further. The button with class=“button” appears to do nothing when clicked. The event is either not there, or is swallowed by something.
I appreciate any help you can provide.