-
Notifications
You must be signed in to change notification settings - Fork 3k
Changes to accessing Custom Data #2812
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
can you give a plnkr example? |
Ok, I figured out the cause. I have a state A.B.C which is abstract, with which I have the custom data associated. Also I have a controller for state A.B.C. Then I define non-abstract states such as A.B.C.1, A.B.C.2 etc. When A.B.C.1 is shown, it uses the controller associated with state A.B.C. The changes from ver 0.2.15 to 0.3.1 seems having changed the way how the inherited custom data is packed. Instead of being an object, it is now an 'extend', which is created by the following code
So to get around of this problem, I can do However, I still question whether this is the intended behavior. |
FYI, this is related to bug #2631 |
Indeed. Thanks @paol |
Closing as a duplicate since it seems duplicated, not just related |
A prettier way to get the old behavior back is found at #3045 (comment) |
I have recently updated ui-route from ver 0.2.15 to 0.3.1 and I noticed that accessing to custom data has been changed. With ver 0.2.15, I could use
_.extend(newVar, $state.current.data)
to initiate newVar using lodash. However, in ver 0.3.1, the properties of$state.current.data
are in$state.current.data.__proto__
. With this change, I have to do_.extend(newVar, $state.current.data.__proto__)
to achieve the same result. Is this intended behavior?Thanks,
The text was updated successfully, but these errors were encountered: