I need to pass a click event from the controller so I used this code:
angular.element(document.querySelectorAll('#cal')).triggerHandler('click');
In my browser it works when put ionic serve but it didn't work on mobile
You can write in this way in your controller.
angular.element(document).ready(function () {
angular.element(document.querySelectorAll('#cal')).triggerHandler('click');
//OR
angular.element(document.querySelectorAll('#cal')).trigger('click');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With