angular-ui / ui-tinymce

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

Using ng-if along with ui-tinymce causes the ngModel controller not to be found #241

Closed zhouzi closed 8 years ago

zhouzi commented 8 years ago

The priority of ui-tinymce being 999, it's higher than ng-if and gets compiled before the ngModel is available. It causes a Controller 'ngModel', required by directive 'uiTinymce', can't be found! to be thrown:

<textarea ng-if="ctrl.show" ng-model="ctrl.input" ui-tinymce></textarea>

Here is a fiddle.

There are two possible solutions:

  1. Decrease the priority to, e.g, 500: fiddle
  2. Apply ng-if to a parent element: fiddle

Let me know what you think and I'll eventually submit a PR :)