Calling a directive function from an ionic header-bar


#1

I have the following plunker http://plnkr.co/edit/3WRDCv?p=preview

I need to call a function in my directive when I press on the ionic header-bar button.
How do you do this?

I thought adding

scope: {
control: '='
}

would work but I get errors.


#2

The solution has been implemented on the plunker. I basically implemented the proposed solution here http://stackoverflow.com/questions/23281948/angularjs-design-calling-a-directive-function-from-another-controller/23282065?noredirect=1#23282065

Basically I added a broadcast to the controller when the button is pressed. And made the directive listen for this and crop the image when it hears the broadcast.