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

static and dynamic tabs is not working #11

Closed
Shemesh opened this issue Oct 26, 2015 · 2 comments
Closed

static and dynamic tabs is not working #11

Shemesh opened this issue Oct 26, 2015 · 2 comments

Comments

@Shemesh
Copy link

Shemesh commented Oct 26, 2015

hi,
@mikejacobson

when trying to use this (awesome) control in our project i encountered a problem and need your help, PLEASE.

i wrap a tabset that have some tabs that have ng-if on them. when the time comes to show those tabs i get the notorious tabContentTransclude error.
i have made a simple plunkr (forked from yours): http://embed.plnkr.co/VDWTrRF7dgYMT19ZY4uN/preview

note what happens when you click the "don't panic" button, look at the console.
how can i solve this?

p.s. moving all the tabs to an array to watch them is not an option for me.

TNX.

@Shemesh
Copy link
Author

Shemesh commented Oct 29, 2015

@mikejacobson

just any idea - how about watching (angular $watch) the html that is generated for each tab.
for example get the div with class "tab-content" and watch when its children is changed.

cont':
seems like using watch is a bad idea
angular/angular.js#10522 (comment)

but maybe some other way to watch for dom changes?

@mikejacobson
Copy link
Owner

@Shemesh, v0.0.20 should fix this.

Here's a fork of your plunk showing it working:
http://plnkr.co/edit/575H1Br10RhX5fNQ5mnB

You just need to add attribute watch-tabs="true" to the scrolling-tabs-wrapper element and it will set up watches on the DOM itself rather than on the tabs array.

Thanks for your suggestion and the follow-up information regarding watching the DOM. Unfortunately, I had to do it that way because the only alternative that I can think of would be to require you to set some specific flags in your code (which I would have watches set on) whenever you add/remove tabs or click to activate a different tab, and that didn't seem like a very reasonable solution. If it seems to be a performance problem, let me know.

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

No branches or pull requests

2 participants