I want to set event onclick for an object not via using ng-click like jQuery syntax:
<button>Click me</button>
<script>
$('button').click(function () {
alert('Hello World!')
});
</script>
My question, is there a way to write event onclick like that in angularjs?
I don't want to use this way:
<button ng-click="sayhello()">Click me</button>
angular.module('myModule', []).controller('myController', function ($scope) {
$scope.sayhello = function () {
alert('Hello World!');
};
});
I want to hide the information ng-click="sayhello()" in the html.