Comments (11)
+1
from sticky-states.
of course it wont change unless u exit the parent state . a sticky state is sticky . it cant be removed until parent is exited . problem is that you are sharing ui-view='view1'
for both of the sticky states . u have to create a ui-view
for each widget in your parent state like this :
ui-view='widget1' ui-view='widget2' ui-view='widget3'from sticky-states.
Unfortunately that is not possible in current project :/.
From my point of view, the ideal workflow for sticky states would be something like this (pseudo):
state_entered() {
#create scope
if(cache[state.name]) scope = cache[state.name].scope
else scope = $rootScope.new();
#create controller
if(cache[state.name]) controller = cache[state.name].controller
else scope = $controller(state.controller, ctrlOptions);
#compile
link = $compile(element);
return link(scope);
}
I tried to create a ui-router plugin for this with a little ui-router modification. I modified ui-router to use own service for creating scope and controller. Here is the diff .
Here is jsbin playground with changed ui-router and plugin implementation. Unfortunately it doesnt work. It does display each state first time. When state is entered again, scope and controller are returned from cache, but the template doesnt get compiled and Im not sure why :(.
I thought this might be alternative to sticky-states but not sure how to fix this. I think the problem is with scope not being handled properly by ui-router. I tried to suppress $destroy event but it doesnt work anyway. :(
from sticky-states.
Hello @christopherthielen ,
we are also getting the same issue where @buksy90 got.
using ng1 (1.6.1)
+ [email protected]
+ uirouter/[email protected]
+ uirouter/[email protected]
+ uirouter/[email protected]
In different scenarios, the stickiness is failing.
- Same as @buksy90 mentioned.
- Here is another example
three tabs used in the above example. home, about and deepnest. The deepnest tab is decorated withsticky: true
. Between home and about tabs the state transition is working fine because there is no stickiness is applied. But when user clicks the deepnest tab and come back to home or about tabs, transitions returns "success" but deepnest view is showing. The about or home view is not updating.
With ui-router-extras
the sticky state functionality working fine. But when we upgrade it to latest uirouter/[email protected]
then we are facing the above issues. Even I checked with all the ui-router latest versions the same issue persists.
Are these issues addressed in coming versions?
from sticky-states.
@buksy90 is this issue resolved to you?
from sticky-states.
Hello @nandakumar531, no I havent found any solution yet.
@christopherthielen could you please share any info on whether this functionality has been ever considered? If so, what is the reasons it hasn't been implemented?
from sticky-states.
@christopherthielen Can you please let us know when this issue will be fixed.
attaching the above example which @buksy90 mentioned again for reference : http://jsbin.com/lohasefoza/5/edit?js,output
from sticky-states.
I'm not sure but check this out : DeepStateRedirect in ui-router extra plugins maybe that will solve your problem
from sticky-states.
My issue is quite similar.
We have sticky on moduleA.home, from there url to moduleA.something won't navigate. The controller of something is not even fired. Note that moduleA is just an abstract state.
- deepStateRedirect = true won't help.
- remove sticky make things work smoothly.
p/s : guys , have u found any solutions
from sticky-states.
This is bugging me as well. Any solution in sight?
from sticky-states.
This behavior is working as designed and isn't going to change. As mentioned by @soroushNeshat in #24 (comment) and in the documentation,
The sticky state's view must have its own unique ui-view (not shared by other states). Create and target a named ui-view.
This limitation is by design and can't be changed. Proposed work arounds such as trying to save and restore components manually would be prone to many edge cases and is not something I'm willing to support. Further, those solutions would only work for one framework (i.e., AngularJS) where as the sticky states approach works for all frameworks (i.e., React, Angular, AngularJS)
So, the answer to this issue is: use named ui-view
and target the named ui-view
in the sticky state. Show and hide the ui-view
when the state is active/inactive.
from sticky-states.
Related Issues (20)
- OnRetain not called
- Sticky state resetting issue HOT 2
- Stuck sticky states HOT 1
- exitSticky typings issue HOT 1
- UI-router uiOnParamsChanged event is not triggered when StickyStatesPlugin is enabled HOT 3
- toggle show sub-views like TAB behavior
- Trouble using angularjs + npm + scripts solution HOT 1
- Action required: Greenkeeper could not be activated 🚨
- Action required: Greenkeeper could not be activated 🚨
- Using sticky-states, the destruction function is not triggered when the page is refreshed HOT 1
- Sticky states + "orphan" state + onExit = transition error HOT 3
- Error with sticky-states and chromium 40 HOT 2
- Sticky States v1.5.0 throws error in IE 11 (Object doesn't support property or method 'find') HOT 2
- Check to see if sticky state is loaded? HOT 2
- Import required even when `exitSticky` property (on `TransitionOptions`) needs to be used. HOT 1
- Load sticky state if non-sticky state was loaded from server HOT 1
- Not able to navigate back HOT 1
- How to deactivate existing sticky state HOT 1
- How to use pamas in sticky state HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sticky-states.