jeudi 18 août 2016

how to get button using id and call its click event - Angular

i have a button that call a function on ng-click , my issue is : how can i get this button using the id and call the click event on my Angular run function, this is my code :

<button ng-click="myfunction()" id="myButton">Click !!</button>


app.run(['$rootScope',function($rootScope) {
// by default i want to click my button when the app is loaded
}]);

Note: i have a problem with "myfunction()" , this why i want to call it indirectly.

thanks in advance.

Aucun commentaire:

Enregistrer un commentaire