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

[q] ui-sref-active but for state params #2799

Closed
ZuBB opened this issue Jun 8, 2016 · 4 comments
Closed

[q] ui-sref-active but for state params #2799

ZuBB opened this issue Jun 8, 2016 · 4 comments

Comments

@ZuBB
Copy link

ZuBB commented Jun 8, 2016

does ui-router have some mechanism to set active class but use state params instead of state name for comparison?

I would say it may be named as 'ui-sref-opts-active' or 'ui-sref-active-opts'

@eddiemonge
Copy link
Contributor

Instead of or in addition to? It already checks name and params as shown in the example at http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.directive:ui-sref-active

@ZuBB
Copy link
Author

ZuBB commented Jun 14, 2016

Instead of or in addition to?

in addition. sorry for confusing description. will it work with multiple items that have same state but different params? like below

          <cad-tabs-item text="atv.dashboard.toggle.draft"
                         ui-sref="advancedtv.dashboard.ssp({status: 'draft'})"
                         ui-sref-opts="{inherit: false}"
                         active="vm.isPassedSspCampaignStateActive('draft')"
                         ng-click="vm.updateRequestedCampaigType('draft')">
          </cad-tabs-item>
          <cad-tabs-item text="atv.dashboard.toggle.rankering"
                         ui-sref="advancedtv.dashboard.ssp({status: 'rankering'})"
                         ui-sref-opts="{inherit: false}"
                         active="vm.isPassedSspCampaignStateActive('rankering')"
                         ng-click="vm.updateRequestedCampaigType('rankering')">
          </cad-tabs-item>
          <cad-tabs-item text="atv.dashboard.toggle.ready"
                         ui-sref="advancedtv.dashboard.ssp({status: 'ready'})"
                         ui-sref-opts="{inherit: false}"
                         active="vm.isPassedSspCampaignStateActive('ready')"
                         ng-click="vm.updateRequestedCampaigType('ready')">
          </cad-tabs-item>
          <cad-tabs-item text="atv.dashboard.toggle.submitted"
                         ui-sref="advancedtv.dashboard.ssp({status: 'submitted', sort: ['confirmationStatusOrder,asc','submittedOn,desc']})"
                         ui-sref-opts="{inherit: false}"

@eddiemonge
Copy link
Contributor

It matches based on what is in ui-sref

@ZuBB
Copy link
Author

ZuBB commented Jun 15, 2016

so my 'example' should work but I need to wait till #2696 will be fixed and released. am I right?

@ZuBB ZuBB closed this as completed Aug 30, 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

2 participants