Note that there are some explanatory texts on larger screens.

plurals
  1. POEmber outlet bound to StateManager doesn't render after changing state twice
    text
    copied!<p>I've setup a State Manager for tracking user login state, based on this answer here: <a href="https://stackoverflow.com/questions/14721174/change-navbar-based-on-login-state">Change Navbar based on login state</a></p> <p>However, I'd like to take it to the next step and have not only the navbar update according to the state, but the main template itself. I've gotten this mostly working so that when you click on the login button it will show you the 'welcome you're now logged in message.' However, if you logout and try to login again, it just shows a blank screen as if it is not correctly re-rendering the index route. Here's a JSFiddle with my issue. Notice what happens when you click on login / logout and then login a 2nd time. the 'welcome' message is not displayed.</p> <p>Here is my index template:</p> <pre><code> {{render navbar}} {{authState}} {{#if isAuthenticated}} {{outlet}} {{else}} {{render login}} {{/if}} </code></pre> <p>I can see the 'authState' is correct, but the 'outlet' is not rendered the 2nd time I login...</p> <p>Here is the complete jsfiddle:</p> <p><a href="http://jsfiddle.net/Benmonro/HmJyu/1/" rel="nofollow noreferrer">http://jsfiddle.net/Benmonro/HmJyu/1/</a></p> <p><strong>CLARIFICATION</strong></p> <p>@ham asked for a clarification, so here goes: </p> <p>The main thing I'm trying to accomplish here is that when a state manager changes the state of <code>isAuthenticated</code> then what is currently rendered in <code>{{outlet}}</code> should be swapped out for what is rendered in <code>{{render login}}</code> which could really be any template. The main point is that <code>{{outlet}}</code> will show and hide w/ the state change...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload