zelocalhost
zelocalhost

Reputation: 1183

onclick function in angularjs : nothing happens

I'm little confused with onclick function , with angularjs...

in my controller, i put this :

$('#mapReload').click(function () {
    alert('lol');
});

nothing work... jquery is correctly added, where i'm wrong ?

Upvotes: 1

Views: 254

Answers (1)

Jayesh Chandrapal
Jayesh Chandrapal

Reputation: 684

In your HTML use ng-click for button click:

<button ng-click="reloadMap()">Map Reload</button>

And in your angularJS controller, write click handler:

$scope.reloadMap = function() {
    alert('lol');
};

Upvotes: 1

Related Questions