0

How to pass data between two states. i tried this and it is not working. I saw that stateparams are depricated and this is not a duplicate thread. This is for UI router 1.0.3

In the first controller

$state.go('state2', {id: $scope.value} );

And in second controller

$scope.state2value = $state.params.id;
Sibiraj
  • 4,486
  • 7
  • 33
  • 57
  • Possible duplicate of [Angular ui router passing data between states without URL](https://stackoverflow.com/questions/28248236/angular-ui-router-passing-data-between-states-without-url) – P.S. May 25 '17 at 17:34
  • This not duplicate..this is a newer version of ui router – Sibiraj May 26 '17 at 04:04
  • Why don't you want to use newer version? If the 1.0.3 version doesn't provide an option to share data between states, just update your ui-router. Or let me know if it's not a solution for your case – P.S. May 26 '17 at 12:17
  • Actually, 1.0.3 is the latest version and I want to know how to pass data. It will support, they did not deprecate a feature, they have deprecated the method. @CommercialSuicide – Sibiraj May 26 '17 at 13:01
  • Does injecting $transition$ and using $transition$.params() as outlined in [this migration guide](https://ui-router.github.io/guide/ng1/migrate-to-1_0#stateparams-deprecation) not work? – Nickel May 26 '17 at 19:02
  • I tried that, but all returns an empty object @Nickel – Sibiraj May 27 '17 at 07:14

0 Answers0