1

How to hide the button for 5s in ember.js

This is my template activation.hbs

{{#if hideResendCode}}
  {{#paper-button raised=true primary=true}}Resend Code{{/paper-button}}
{{/if}}

and this is my controller activation.js

hideResendCode:Ember.run.later((function() {

 }), 5000),

I don't know how to hide this button for 5s please help me.

Girja Shanker
  • 85
  • 1
  • 10

1 Answers1

0

You need to run scheduler in init.

{{#if showResendCode}}
  {{#paper-button raised=true primary=true}}Resend Code{{/paper-button}}
{{/if}}

And

    //activation.js
    showResendCode: true,

init(){
  this._super(...arguments);
    Ember.run.later(this, function() {
          this.set('showResendCode', false);
        }, 5000);
}
Ebrahim Pasbani
  • 9,168
  • 2
  • 23
  • 30