Skip to content

fix(renderer): set templateParent to comment and text nodes #785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 9, 2017

Conversation

sis0k0
Copy link
Contributor

@sis0k0 sis0k0 commented May 5, 2017

When createText() method of the renderer is called, the newly created CommentNode elements (plain JS objects) are not attached to the visual elements tree.
However, we set a templateParent to them in the insertChild method and return it instead of parent in the parentNode method.

Changes:

  • Plain JS objects (CommentNode) with just meta: skipAddToDom and templateParent are created both for text nodes and comment nodes in the renderer.
  • NgView, NgElement, CommentNode and a few other are moved to separate module - element-types.ts
  • Comments are no longer attached to visual tree.
  • Unit tests for NgIfElse and NgIfThenElse added.

DetachedText is not inserted in the UI components tree, so we need to
add it's parent manually.
@sis0k0 sis0k0 force-pushed the vlaeva/renderer-fixes branch from 2ac42a0 to a1ff6c7 Compare May 5, 2017 08:31
@sis0k0 sis0k0 force-pushed the vlaeva/renderer-fixes branch from 7964d08 to 24161e7 Compare May 8, 2017 07:55
@sis0k0 sis0k0 force-pushed the vlaeva/renderer-fixes branch from 24161e7 to 108e4d0 Compare May 8, 2017 08:48
@sis0k0 sis0k0 requested a review from vakrilov May 8, 2017 11:45
@sis0k0 sis0k0 changed the title [WIP] fix(renderer): set templateParent to DetachedText nodes fix(renderer): set templateParent to DetachedText nodes May 8, 2017
@sis0k0 sis0k0 changed the title fix(renderer): set templateParent to DetachedText nodes fix(renderer): set templateParent to comment and text nodes May 8, 2017
@sis0k0
Copy link
Contributor Author

sis0k0 commented May 9, 2017

fixes #777, fixes #787, fixes #789

@sis0k0 sis0k0 merged commit b127ba7 into master May 9, 2017
@sis0k0 sis0k0 deleted the vlaeva/renderer-fixes branch May 9, 2017 13:46
@sis0k0 sis0k0 restored the vlaeva/renderer-fixes branch July 10, 2017 14:29
@vakrilov vakrilov deleted the vlaeva/renderer-fixes branch October 6, 2017 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants