angular-ui / ui-tinymce

AngularUI wrapper for TinyMCE
MIT License
488 stars 371 forks source link

ng-click doesn't work #245

Closed andypoorman closed 4 years ago

andypoorman commented 8 years ago

When a text area does not have tinymce, ng-click works fine. When it has it, ng-click no longer fires.

deeg commented 8 years ago

Please post a reproduction of the issue using plunker so we can investigate and fix.

andypoorman commented 8 years ago

http://plnkr.co/edit/VGVCfDIxtvPDlEDTCwrJ?p=preview

deeg commented 8 years ago

@andypoorman, thanks for posting that.

It does make sense to me since TinyMCE gets rendered within an iframe, the ng-click does not see the click event.

Could you try using TinyMCE's onClick handler instead?

An enhancement for this library could be to make ng-click function get injected automatically into the tinymce onclick handler. I'm not sure it is worth it for the bloat it would cause, but I'm open to looking at implementations in the form of a PR!

andypoorman commented 8 years ago

For my specific use case, it's hard to get access to all the angular goodness in TinyMCE that I'd like without getting "creative".

deeg commented 8 years ago

@andypoorman I am confused by that. Using TinyMCE's onclick handler you should be able to set it up to run the same function you would be supplying to ng-click. Is there a specific reason you think you would not be able to do that?

Could you provide a plunker demonstrating why and maybe I could help?