Could I user "Router.go()" with new tab/windows?


#1

Could I user “Router.go()” with new tab/windows?

Router.go(...)   -> with new tab/windows

#2

There is probably a better way to what you are trying to do. (Take it with a grain of salt as I am pretty new). But I know that you can add target="_blank" in an <a> tag.


#3

Thanks for your reply, but I want to use on Rounter.go()


#4

Correct me if I am wrong, but when you open up a tab that creates a new instance of the website. You could login as a different user. As far as I know, iron:router routes for one instance. For what you are doing it would be just as effective to use what I put above or do Window.open(yourUrl, “_blank”)


#5

Woops, you don’t need the “_blank” in the window.open() I just tested this out with my own website using

window.open(Router.url('countries', {countryId: event.mapObject.id, cityId:1}));

And it worked perfectly :smiley: it opened up a new tab on the correct page.
Edit: ‘countries’ is my route name, the things in curly braces are my params.


#6

Thanks again, I will try the second option (Window.open).