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

Delayed tab state resolves possible? #83

Closed
skidvd opened this issue Aug 26, 2016 · 1 comment
Closed

Delayed tab state resolves possible? #83

skidvd opened this issue Aug 26, 2016 · 1 comment

Comments

@skidvd
Copy link

skidvd commented Aug 26, 2016

I have a set of tabs using these very helpful (thank you!) directives that is working fine. However, I have run across a new consideration that I am hoping you may be able to offer some thoughts or ideas on please?

The scenario is a follows:

  • tabset contains a set of tabs, each of which corresponds to a route/state
  • each route/state has their own resolves associated with them

This works/functions just fine. However, I am noting that the resolves for ALLroutes/states are hit upon display of the tabset (even though obviously only a single tab is active/displayed at a time). This is normally not an issue; but, when the resolves are extensive and/or long running in nature, this is inefficient and may delay display of the targeted/active tab until the longest resolve has finished.

Any thoughts on how one might delay execution of the non-targeted tabs unit and if they are actually ever actived?

I attempted to use the tab.active value in combination with ng-if on the ui-view as shown below, but this did not delay or preclude the resolves for the non-active routes/states.

<tabset class="tab-container" type="{{::type}}" vertical="{{::vertical}}" justified="{{::justified}}"> <tab class="tab" ng-repeat="tab in ::tabs | roleAuthorized track by tab.heading" active="tab.active" disabled="tab.disabled" ng-click="go(tab)"> <tab-heading> {{::tab.heading}} <span ng-if="tab.newCount" class="newBadge">{{tab.newCount}}</span> <span ng-if="tab.actionCount" class="action">{{tab.actionCount}}</span> <span ng-if="tab.warningCount" class="problem">{{tab.warningCount}}</span> </tab-heading> <ui-view ng-if="tab.active"></ui-view> </tab> </tabset>

Any other ideas, suggestions or better approaches would be appreciated please!

TIA!!!

@skidvd
Copy link
Author

skidvd commented Aug 29, 2016

Upon further investigation, I have determined that this issues does NOT happen with using standard ui-router states associated with the 'route' attribute for the tab. It only occurs when using ui-router views to populate the tab contents with. In that case, loading them all simultaneously may be the expected behavior. However, if there are ideas to delay resolve loading even in that case, I'd still be interested in hearing about them.

Apologies for the confusion.

@skidvd skidvd closed this as completed Aug 29, 2016
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

1 participant