I have attached a picture of the click action I want to run from the Chrome console, with various values passed. The button is highlighted in gray top right in the inspect element. It is the savePublish() function I want to learn how to access/use.

The button element is inside a <div ng-controller="ProductEditCtrl as ctrl" .. > container, but of course there are other controller wrappers on the page aliased as ctrl
My question is, how do I access the savePublish() method directly from the Chrome console? And a bonus question-answer would be, how would I load the ProductEditCtrl controller and then call the savePublish method on a different page?
Try - angular.element($0).scope() to inspect the scope of the button or you can use Chrome extenstion like ng-inspector.
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