Last active
May 24, 2020 12:08
-
-
Save chinboon/e66743ee1526a035e4147ca651e2111c to your computer and use it in GitHub Desktop.
Ember Init Onload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Components | |
| import Component from '@ember/component'; | |
| const CApproveTransactionModalButton = Ember.Component.extend({ | |
| actions: { | |
| ... | |
| }, | |
| didInsertElement: function() { | |
| Ember.run.scheduleOnce('afterRender', this, function() { | |
| $('#approve-transaction-modal').modal(); | |
| }); | |
| } | |
| }); | |
| CApproveTransactionModalButton.reopenClass({ | |
| positionalParams: 'params' | |
| }); | |
| export default CApproveTransactionModalButton; | |
| # Route | |
| import Route from '@ember/routing/route'; | |
| export default Route.extend({ | |
| model() { | |
| ... | |
| }, | |
| setupController: function(controller, models){ | |
| Ember.run.schedule('afterRender', this, function () { | |
| // if input fields have pre-defined values, to prevent overlap | |
| M.updateTextFields(); | |
| }); | |
| }, | |
| actions: { | |
| ... | |
| } | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment