sachinchoolur / angular-trix

A rich WYSIWYG text editor directive for angularjs.
http://sachinchoolur.github.io/angular-trix/
MIT License
328 stars 62 forks source link

Binding not working in directive #37

Open pbaumer2 opened 7 years ago

pbaumer2 commented 7 years ago

I have the following directive code and the ng-model does not work. I understand trix-change is not fired for this element. I tried ng-if, the model is now there but it has empty value and does not change.

<div class="chapter-title">
     <trix-editor style="width:100%;" angular-trix placeholder="write here" ng-model="mydata" ng-model-options="{debounce: 1000}">
     </trix-editor>
    <div>mydata:{{mydata}}</div>
</div>

Without ng-if, I see the following error:

angular.js:13920 TypeError: Cannot set property 'nodeValue' of undefined at interpolateFnWatchAction (angular.js:9741) at interpolateFnWatcher (angular.js:12426) at watchGroupAction (angular.js:17190) at Scope.$digest (angular.js:17524) at Scope.$apply (angular.js:17790) at done (angular.js:11831) at completeRequest (angular.js:12033) at XMLHttpRequest.requestLoaded (angular.js:11966)