Iron router on click button


#1

I have this code

Template.home.events 'click .buy': (event) ->
  event.preventDefault()
  ???
  return

After the user click the button (buy) I want it will go to a router path /product. What shall I add in my code?


#2
Router.go('/yoururl');

Relevant entry in the Iron router guide


#3

@MazDev thanks it works!


#4

@MazDev Maybe you like to answer it in stackoverflow http://stackoverflow.com/questions/29429365/meteor-js-iron-router-on-click-button. I can give the points to you :smiley:


#5

Done, thanks.

(I need 20 chars to post)