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

Weird angular-trix directive behavior when put inside ng-repeat. #9

Closed pedropapa closed 8 years ago

pedropapa commented 8 years ago

I'm using angular-trix in one of my projects and recently I faced an weird problem where angular-trix doesn't work.

The problem is: I have an array of objects variable that is print in an template inside an ng-repeat, this ng-repeat calls an custom directive, that then calls trix-editor. For some reason, only if I put that custom directive in an ng-repeat logic the trix-editor is loaded, but it's content is not shown.

You can see the problem live in: http://plnkr.co/edit/sOk5GrFJuOwMNUQf8E7V?p=preview

if you just remove < directive-text > from the ng-repeat logic and replace member="member" to member="members[0]" the directive works!

ablamunits commented 8 years ago

I remember experiencing a similar issue in our project, and we were able to overcome this weird behaviour by adding ng-if="true" on the trix-editor element. It seems to work in your case as well.

Regardless, it seems that the developer of angular-trix is no longer supporting / responding to threads here.

pedropapa commented 8 years ago

@ablamunits Thank you!

achousa commented 7 years ago

@ablamunits Thanks for that tip !

We where having a similar issue, which would throw "TypeError: Cannot read property 'childNodes' of undefined at compositeLinkFn" when the trix-editor was included inside a transcluded div. This was happening only in chrome.

Adding ng-if="true" has fixed the issue.