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

How to remove dynamically created states? #3115

Closed
achenge07 opened this issue Oct 27, 2016 · 2 comments
Closed

How to remove dynamically created states? #3115

achenge07 opened this issue Oct 27, 2016 · 2 comments

Comments

@achenge07
Copy link

Hi guys, I used $stateProvider in angularJS 1.5.8 to create dynamic states but I don't know how to remove these states.

I know this question has been discussed several times, here the links:
#1095
#2265
#2711
However, I didn't find a easy way in these posts.

It seems that the remove states feature has been added, link:
44579ec
But I'm a newbie so it's too difficult for me to find the right way to remove states.

Is there anyone kindly give me some instructions about how to remove states? Any suggestions would be appreciated.

Thanks
yorven

@christopherthielen
Copy link
Contributor

Deregistration is only possible in 1.0 beta version. https://ui-router.github.io/docs/latest/classes/state.stateregistry.html#deregister

You can access the registry by injecting $uiRouter

app.run( function($uiRouter) {
  $uiRouter.stateRegistry.deregister('foo');
});

@RonakShah
Copy link

Thanks @christopherthielen. But does the latest version of UI-Router includes this feat? #1809

How can I reload named nested view only (not sure if possible in latest version) and also dynamically update state registry (possible in latest version) in single UI-Router ng1 library?

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

3 participants