Skip to content

Instantly share code, notes, and snippets.

View serenaf's full-sized avatar
😅
Always learning

serena serenaf

😅
Always learning
View GitHub Profile
import Ember from 'ember';
export default Ember.Component.extend({
hasName: Ember.computed.notEmpty('name'),
actions: {
log(message) {
console.log(message);
}
}
});
@serenaf
serenaf / application.controller.js
Last active October 26, 2017 16:51 — forked from kevinkucharczyk/application.controller.js
Contextual Popover Component
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
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')}`);
}