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

How do you trigger routes from markup? #15

Closed
mgutz opened this issue Jan 6, 2015 · 2 comments
Closed

How do you trigger routes from markup? #15

mgutz opened this issue Jan 6, 2015 · 2 comments

Comments

@mgutz
Copy link

mgutz commented Jan 6, 2015

In template

<li><a href="#!/login">Log In</a></li>

In the root VM

    routes: {
        '/home': {
            componentId: "home",
            isDefault: true
        },

        '/login': {
            componentId: "login"
        },

        '/signup': {
            componentId: "signup"
        },

        options: {
            hashbang: true,
            debug: true
        }
    }

I expect the login route to trigger and render the login component when the link is clicked but nothing happens. If the page is refreshed, the login route triggers.

I'm on latest Chrome.

@mgutz
Copy link
Author

mgutz commented Jan 6, 2015

So the markup need to look like this regardless of the hashbang option

<li><a href="/login">Log In</a></li>

And if you want to bypass routing, use target="_self"

<li><a href="/realpage" target="_self">Log In</a></li>

@mgutz mgutz closed this as completed Jan 6, 2015
@ayamflow
Copy link
Owner

ayamflow commented Jan 6, 2015

Yes, links are independent from the hashbang. I will add this in the docs.

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

2 participants