Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicking a link with a relative path works out of the box? #215

Closed
trusktr opened this issue Jul 18, 2015 · 5 comments
Closed

Clicking a link with a relative path works out of the box? #215

trusktr opened this issue Jul 18, 2015 · 5 comments

Comments

@trusktr
Copy link

trusktr commented Jul 18, 2015

I have

<a href="/path"></a>

and when I click the link the router works! I didn't have to do

Template.x.events({
  'click a': function(e) {
    e.preventDefault()
    FlowRouter.go('/path')
  }
})

Is this handled by flow-router? Handled by Meteor?

@arunoda
Copy link
Contributor

arunoda commented Jul 18, 2015

Links are normally handled by flow-router. FlowRouter.go() if you need to do it manually.

@trusktr
Copy link
Author

trusktr commented Jul 18, 2015

Where's the code that handles those links?

@arunoda
Copy link
Contributor

arunoda commented Jul 21, 2015

It's done by page.js the library we use behind the scene.

@arunoda arunoda closed this as completed Jul 21, 2015
@arunoda arunoda removed the question label Jul 21, 2015
@sahanDissanayake
Copy link

Having this issue right now
https://forums.meteor.com/t/meteor-reactjs-why-reloading-page/9972/5

I need to prevent the link click, but need the href to be there for SEO, Do not know why I cannot use

clickEvent.stopPropagation();
clickEvent.preventDefault();
return false;

to stop the click event

@sahanDissanayake
Copy link

maybe similar to this #156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants