Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Instantiate Tinymce event if id is generated with angular expression in ngRepeat #354

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

stollr
Copy link

@stollr stollr commented Feb 23, 2018

For dynamically created editors (e.g. with ngRepeat) the unique id that is generated and set to the element during linking may be overwritten, if the id is generated with an angular expression, so we have to overwrite it again.

Otherwise tinymce won't be initialized.

Here's an example:

<div ng-repeat="item in collection">
    <textarea id="foo_{{ $index }}"
              name="foo_{{ $index }}"
              ui-tinymce="{{ some_config }}"
              ng-model="item.foo">
    </textarea>
</div>

During linking of uiTinymce the id is set to something like "ui-tinymce-3". But then it replaced to something like "foo_2" and in tinymce.init() it won't find the element, because it uses the selector "#ui-tinymce-3".

… may be overwritten, if the id is generated with an angular expression, so we have to overwrite it again.

Otherwise tinymce won't be initialized.
…orms that are already dirty (for dynamically added editors)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant