Reputation: 85
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.
Upvotes: 1
Views: 400
Reputation: 9406
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);
}
Upvotes: 0