Similar to what this user is trying to acheive: manually calling click() on a button, can I pass any parameters?
I would like to do the same in angular JS.
Something like:
angular.element("mySelector").trigger("click",[{param1:val1}]);
and the access param1
in the triggered function:
scope.toggleForm = function ($event) {alert($event.param1);}
Please note that angular.element("mySelector") returns an array of elements which i want to trigger the click event for each one of them separately.
Do you think this is possible? I guess I'm going to use $broadcast eventually but would love to hear some ideas.