This repository was archived by the owner on Sep 8, 2020. It is now read-only.
This repository was archived by the owner on Sep 8, 2020. It is now read-only.
Accidentally $setPristine on parent form controller #253
Open
Description
I'm encounter problem caused by this line of code https://github.com/angular-ui/ui-tinymce/blob/master/src/tinymce.js#L84 which set parent form a pristine state on its init
event. I use ui-tinymce inside an ngIf which may cause the ui-tinymce initialize multiple times when user switch between different type of model
it looks like this snippet
<div ng-if="component.type==='image'">
<image-component ng-model="component.data"></image-component>
</div>
<div ng-if="component.type==='text'">
<textarea ng-model="component.data" ui-tinymce></textarea>
</div>
So what I expect is the ui-tinymce should not invoke form.$setPristine() on its initialisation.