jeudi 10 août 2017

Ember view flashing on load and refresh

I am very new to Ember, and have been handed an application with various issues to solve. It is a 5(possibly more) year old project, using Ember 1.4.

I have two views:

  • LoginPageView
  • DashboardView

In the index.html page I have a handlebars script tag with an if statement, like so:

<script type="text/x-handlebars">
  
    
  
    
    
  
</script>

When a user logins in, they are directed to the DashboardView but the LoginPageView flashes for a split second, and when the user is logged in, if they hit refresh, the LoginPageView flashes, making the application look untidy and a bit unprofessional.

I can't see anything wrong with the syntax, only thought could be is that the template.js file I am using is a large file and is taking its time to load?

Question

How do I prevent the LoginPageView from displaying on login and/or when the user refreshes the page?

If you need any more information i.e. script, html, just let me know.

TLC.LoginPageView = Ember.View.extend({
  templateName: 'LoginPage',
});

TLC.DashboardView = Ember.View.extend({
  templateName: 'Dashboard',
});




Aucun commentaire:

Enregistrer un commentaire