Skip to content
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

Tabset component removeTab method doesn't work with Angular Universal #2778

Closed
agustinhaller opened this issue Oct 2, 2017 · 3 comments
Closed

Comments

@agustinhaller
Copy link

  • Angular version: 4.4.3
  • ngx-bootstrap version: 1.9.3
  • build system: angular cli (Universal + AoT)
  • Use case: Tabset component doesn't work with Angular Universal

There's a bug in the tabset component that's causing an error with angular universal.

The error I'm getting is:

TypeError: tab.elementRef.nativeElement.parentNode.removeChild is not a function    
at TabsetComponent.removeTab ...

I think the issue is caused because you are accessing the DOM directly in this line:

tab.elementRef.nativeElement.parentNode.removeChild(

Maybe there's an easy fix for this using the Renderer2 removeChild method instead of parentNode.removeChild

I think this is a very important issue because a small issue is preventing ngx-bootstrap to work correctly with Angular Universal. After searching in this repo, I found that this same issue may be affecting the modal directive as you use the parentNode.removeChild directly through the DOM instead of using the Renderer2 method.

@agustinhaller
Copy link
Author

@valorkin Do you think using Renderer2 would be a good solution for this issue?

@valorkin
Copy link
Member

valorkin commented Oct 2, 2017

yep, it should be

@stemyke
Copy link

stemyke commented Oct 11, 2017

@valorkin I just ran into the same issue 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants