-
Notifications
You must be signed in to change notification settings - Fork 3k
0.2.16 breaks state data inheritance #2631
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
Comments
You are probably right about this being a breaking change. It might be hard to roll it back now though since there have been a few version releases since then and most effort is going towards 1.0 @christopherthielen thoughts? |
We recently tried to upgrade from 0.2.15 to 0.2.18 and ran into this problem. In our case we are iterating over the data object with angular.foreach(), which misses the inherited properties. It is indeed a breaking change. |
Unfortunately the cat is out of the bag. I've noted this as a BC in the 1.0 upgrade notes. |
I came here from a google search on the subject, so for other users searching for more information on the subject including @christopherthielen's polyfill to get the old behavior back, read this: http://stackoverflow.com/questions/38676633/angular-ui-router-child-of-abstract-state-not-inheriting-data-in-statechanges/42107929#42107929 |
@motin thanks for the nice writeup on the StackOverflow question. I've updated the plunker demonstrating how to merge data on the child with the data on the parent: http://plnkr.co/edit/Wm9p13QRkxCjRKOwVvbQ?p=preview |
I believe this is a result of: $state: make state data inheritance prototypical (c4fec8c).
In my code, I use
data.hasOwnProperty(someVar)
to check whether a requested value exists. The switch to prototypical inheritance breaks this check and causes a lot of breakage on my site. This is a major breaking change, thereby necessitating a 0.3.x version! I've been able to fix this by simply changing my checks tosomeVar in data
, but it took quite a bit of debug time to isolate the cause of the failure.The text was updated successfully, but these errors were encountered: