-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Tabs: don't transclude content initially to check for nav-view #730
Comments
I guess the question is why do the tabs have anything to do with the nav system? I know the tabs rely on the nav stuff, but we should think about how to decouple them as much as possible. |
Currently, we simply need to associate a tab with any nav-view inside it, so we can select the tab if the url switches to that navView. The better way to do this would be to put an attribute on the tab saying which nav-view it is associated with, so we don't have to initially transclude the content and check for a nav-view. Alternatively, we could do our own transclusion (not using angular's default, which lets us know the html of the element) and just check for a nav-view in the HTML string during the compile phase. That might be the best? |
OK, that works. We can simply not use angular transclusion.
on my fork: ajoslin@7d33e4f#diff-f9bd4c766836959edb16dde8bb0ebb7cL153 |
To answer @mlynch's question, if a URL is for a tab that's not the first tab, when that URL is the initial load it needs to know to open up the correct tab. Whatever the best most efficient way to accomplish this I'm all for. |
What if the nav-view inside the tab sends a "register" event up the scope On Wed, Mar 5, 2014 at 12:39 PM, Adam Bradley [email protected]:
|
The problem is a tabs content is not put into the Dom until it is selected, So we can check the nav views name without rendering or compiling the
|
I see. So the other question is, is it worth it to enable this feature, which is really only relevant during development? One alternative from a developers point of view is to control the experience through their own code. For example, if you wanted to use a URL routing system, you might just listen for a URL, and what that is hit, perform some code to select that tab, like this pseudocode: $urlRouter.on('/tab/cats', function() {
selectTab(1);
}); When in doubt, I'd perfer doing less, assuming less, and making it easier for the developer to control the experience. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
How we we find out if there's a nav-view in the tabs is to transclude the content initially, but do nothing with it. This could have side effects that we aren't prepared to deal with (eg creating a controller for a moment could set a variable or basically anything).
It also causes this error:
The text was updated successfully, but these errors were encountered: