Skip to content
This repository has been archived by the owner on Sep 20, 2020. It is now read-only.

How to switch to a child state without losing hidden params? #370

Open
cbranca opened this issue May 8, 2017 · 1 comment
Open

How to switch to a child state without losing hidden params? #370

cbranca opened this issue May 8, 2017 · 1 comment

Comments

@cbranca
Copy link

cbranca commented May 8, 2017

Hello, I have a page with two tabs and I need to save the state with Sticky State and DeepStateRedirect. So, when I switch tabs, I expect to get the same state when I go back.

In the tabs i have this:
tab1: ui-sref="admin.config.panel.customer"
tab2: ui-sref="admin.activity"

My app has these states:
page (deepStateRedirect: { default: 'page.config', params: true })
page.config (deepStateRedirect: { default: 'page.config.panel', params: true })
page.config.panel (deepStateRedirect: { default: 'page.config.panel.customer', params: true })
page.config.panel.customer
page.config.panel.edit
page.activity

The default state of tab1 is page.config.panel.customer with params null, but if i select a customer from the tree inside page.config i can go to page.config.panel.customer or page.config.panel.edit passing hidden parameters (example: customerId and userId).
The problem is that if I am in page.config.panel.customer or page.config.panel.edit, and i go to tab 2, and then I go back to tab 1, it returns me to admin.config.panel.customer with params null, but I want go back to page.config.panel.customer or page.config.panel.edit state with the params that I passed.

If i put ui-sref="admin.config" in the tab1 it gives me "Error: Transition prevented".
So I really can't figure out how to solve this. Any help?

@cbranca
Copy link
Author

cbranca commented May 8, 2017

If i put ui-sref="admin.config.panel" in the tab1 seems to work, but it continues to give me "Error: Transition prevented".
The only solution I found is to put "$qProvider.errorOnUnhandledRejections(false);" in the config.
Is it ok to use such solution?

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

No branches or pull requests

1 participant