Skip to content

Instantly share code, notes, and snippets.

View locks's full-sized avatar
🌟
Ember Polaris

Ricardo Mendes locks

🌟
Ember Polaris
View GitHub Profile
@locks
locks / application.js
Last active July 28, 2017 09:47 — forked from jmacqueen/application.js
Create an Ember application instance that can be imported into any file. Useful for container lookups in files outside of the usual hierarchy.
// app/instance-initializers/application.js
import appInst from 'appName/utils/application'
export function initialize( appInstance ) {
appInst.instance = appInstance
}
export default {
name: 'application',
initialize
};
@locks
locks / components.my-component.js
Last active April 13, 2018 07:53 — forked from lolmaus/components.my-component.js
classNames / classNameBindings
import Ember from 'ember';
export default Ember.Component.extend({
classNameBindings: ['colorBoolInternal:purple'],
});
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['flip-container']
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@locks
locks / actionReceptive.js
Last active August 2, 2016 11:29 — forked from barneycarroll/actionReceptive.js
Primary actions
import Ember from 'ember';
export default Ember.Mixin.create( {
attributeBindings : [ 'action:data-ember-action' ],
click() {
this.sendAction()
}
} );
@locks
locks / components.my-component.js
Last active July 29, 2016 12:27 — forked from muttli/components.my-component.js
ember component action debugging
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
close() {
alert('Success')
}
}
});
@locks
locks / components.the-child.js
Created July 15, 2016 13:21 — forked from blatyo/components.the-child.js
Child calls Parent
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
callParent() {
this.get('callParent')(this.get('name'));
}
}
});
@locks
locks / components.x-child.js
Created July 14, 2016 13:20 — forked from btecu/components.x-child.js
Component Lifecycle Mut
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super(...arguments);
console.log('\ninit', this.get('vInit'));
this.set('vInit', 99);
this.get('setThingie')('vInit', 99);
},
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
isLoading: false,
counter: 0,
actions: {
load: function() {
var counter = 0;
import Ember from 'ember';
export default Ember.Component.extend({
});