0

I want to navigate to some page in angular2 along with data, while doing so data is coming in URL. Is there a way to pass data without showing it in URL?
I'm using the following code:

this._router.navigate('test',{hugeJsonData: JSON.stringify(bigJson)});
Krishna
  • 1,865
  • 4
  • 18
  • 26
  • navigating reload its so if you dont want in url just stringify and add in local storage – mayur May 19 '16 at 12:52
  • The next update (RC.4) will bring `data` back to the router. This allows you to pass data that will not modify the URL. See also http://stackoverflow.com/questions/37077094/angular2-rc1-new-router-and-passing-data/37078196#37078196 – Günter Zöchbauer Jun 30 '16 at 14:18

1 Answers1

0
let link = ['Home'];                     this.__router.parent.hostComponent.isLoaded = "Anshuman";
this._router.navigate(link);

and you will get it in child as

this.__router.parent.hostComponent.isLoaded
anshuVersatile
  • 2,030
  • 1
  • 11
  • 18