0

I have a fb login integrated in my ember app.I have used ember-simple-auth to implement this.I am facing problem for the first time user.I have to show some onboarding screen to the first time user.For this my server is sending a sign_up flag as false for the first time user when he log in and when he finishes all the onboarding screen I will make an api call to server to make it true.From next time onwards if user log in again the sign_up is true and I should move him directly to feed screen rather than showing him the onboarding screen.

I am not sure how to do this.Is there any good article about it?.Please share some code how to do it.Thanks in advance.You will be life saver.

nandanself
  • 835
  • 8
  • 21

1 Answers1

0

You can create a computed property in your controller which observes sign_up flag like this.

isSignedUp: Ember.computed('sign_up', function(){
    return this.get('sign_up');
})

Now in your template, you can have your onboard screen with conditional rendering like this:

{{#if isSignedUp}}
    <h1>You are signed in</h1>
{{else}}
    <h1>This will be the place to put your onboard screen</h1>
{{/if}}

Note: you can also directly use sign_up flag in your template for conditional rendering. I have used a computed property just to show you. Hope it helps.

ashfaq.p
  • 5,379
  • 21
  • 35