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

'if else' not working properly with the router links #6

Closed
oren opened this issue Jan 2, 2017 · 3 comments
Closed

'if else' not working properly with the router links #6

oren opened this issue Jan 2, 2017 · 3 comments

Comments

@oren
Copy link

oren commented Jan 2, 2017

I am not sure if it's a problem with the router or with svelte itself.

When I add if else like this:

{{#if loggedIn}}
  <li><Link to='/home'>Home</Link></li>
{{else}}
  <li><Link to='/about/bob'>About <em>Bob</em></Link></li>
  <li><Link to='/about/alice'>About <strong>Alice</strong></Link></li>
{{/if}}

if loggedIn is false I expect to see 'About Bob' and 'About Alice' but instead of 'About Bob' I see 'Home'
pic

Here is a sample repo that reproduce this issue:
https://github.com/oren/svelte-router-example-test/blob/1dca6e57a9e88a736ddee727f7f45b6832ad83bf/src/App.html

@Andorbal
Copy link
Owner

Andorbal commented Jan 3, 2017

Looks like this is an issue with Svelte: sveltejs/svelte#231

@oren
Copy link
Author

oren commented Jan 3, 2017

Thanks!

@oren oren closed this as completed Jan 3, 2017
@PaulBGD
Copy link

PaulBGD commented Jan 4, 2017

Yep! I'm currently looking into it and hopefully I can get a PR open by the weekend.

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