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

State transition breaks ES6 Map when passed through optional $stateParams in a ui-sref #3189

Closed
mrohr opened this issue Dec 7, 2016 · 1 comment · Fixed by #3330
Closed

Comments

@mrohr
Copy link
Contributor

mrohr commented Dec 7, 2016

When using an ES6 Map as a optional state param in order to pass data from one state to another, the Map object's methods stop working once passed through to another state.

http://plnkr.co/edit/TVANV1Cnb8B7h95mNjmW?p=preview

in the plunkr, transitioning between states without passing any stateParams works, and just instantiates a new Map. If you click one of the links that passes the Map as a stateParam, the plunkr breaks with the error:

Method Map.prototype.<methodName> called on incompatible receiver #<Map>

@mrohr
Copy link
Contributor Author

mrohr commented Dec 7, 2016

Just did a little more digging, and its specifically ui-sref links with params that break. I've updated the plunkr to add two buttons that call $state.go instead, and those pass the parameters as expected.

http://plnkr.co/edit/b5Sja92rOcMpeKUrgebL?p=preview

@mrohr mrohr changed the title State transition breaks ES6 Map when passed through optional $stateParams State transition breaks ES6 Map when passed through optional $stateParams in a ui-sref Dec 7, 2016
nahuel-soldevilla added a commit to IntegratedBreedingPlatform/Fieldbook that referenced this issue Sep 27, 2018
Following these steps:
- npm install uirouter/core uirouter/sticky-states uirouter/angularjs
- copy minified js

To be able to receive params by reference, needed for subobservation
nested state
(see angular-ui/ui-router/issues/3189)

Issue: BMS-5187 / BMS-5188 / BMS-5189
Reviewer: None
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

Successfully merging a pull request may close this issue.

1 participant