Skip to content

Instantly share code, notes, and snippets.

Avatar
😅
Always learning

serena serenaf

😅
Always learning
View GitHub Profile
View components.create-segment-modal.js
import Ember from 'ember';
export default Ember.Component.extend({
hasName: Ember.computed.notEmpty('name'),
actions: {
log(message) {
console.log(message);
}
}
});
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
View components.child-elements.click-attribute.js
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
stopPropagationAndLog(event) {
// This action has access to the DOM event and can call
// stopPropagation on it to prevent the event from bubbling.
event.stopPropagation();
this.get('log')(`clickAttribute w/ stopPropagation of ${this.get('parentName')}`);
}