Skip to content

Instantly share code, notes, and snippets.

@chinboon
Last active May 24, 2020 12:08
Show Gist options
  • Select an option

  • Save chinboon/e66743ee1526a035e4147ca651e2111c to your computer and use it in GitHub Desktop.

Select an option

Save chinboon/e66743ee1526a035e4147ca651e2111c to your computer and use it in GitHub Desktop.
Ember Init Onload
# 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