0

I would like to open new tab with Iron:Router. How can I open new tab with Router.go() and Pass some data?

Phirum
  • 655
  • 2
  • 6
  • 12

1 Answers1

-1

For Example you have a profile route with the _id of the user, this will work.

 Router.go('/profile',Meteor.userId())
Ethaan
  • 11,291
  • 5
  • 35
  • 45
  • 1
    thanks but It doesn't open new tab. How can I open the new tab with Router.go() function? – Phirum Apr 06 '15 at 08:20
  • 1
    Hi @Phirum check [this related SO](http://stackoverflow.com/questions/4907843/open-a-url-in-a-new-tab-using-javascript) you can do it with plain javascript, with iron router, you only will get a refresh page with `router.go` you can do something like this, using javascript + iron:router `window.open(Router.url(path, params, someQueryt));` following this syntaxis – Ethaan Apr 06 '15 at 15:09
  • 1
    Ethaan is correct, you need `window.open(url)` to open a new window and then it's only a question of generating the url you want. – Michel Floyd Apr 07 '15 at 02:18
  • thank @Ethaan and @Michel Floyd. It works with `window.open();` – Phirum Apr 10 '15 at 10:45