Skip to content

Instantly share code, notes, and snippets.

@kumkanillam
kumkanillam / index.html
Created August 18, 2020 07:12
Pinwheel - pure JavaScript
<canvas id="canvas">Canvas not supported.</canvas>
@kumkanillam
kumkanillam / components.pricing-user-edition.js
Last active February 26, 2019 08:04
MixinPropsChnagedInComponent
import Ember from 'ember';
export default Ember.Component.extend({
init(){
this._super(...arguments);
console.log('pricing component init ',this.get('adminCount'));
},
didInsertElement(){
this._super(...arguments);
},
import Ember from 'ember';
import QueryParams from 'ember-parachute';
export const myQueryParams = new QueryParams({
'qps.housingType': {
as: 'type',
defaultValue: 'single',
},
'qps.objectType.anotherProp': {
defaultValue: 'test',
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions:{
keyPressClick(){
console.log('keyPressClick');
},
onClick(){
console.log('onClick');
@kumkanillam
kumkanillam / components.my-component.js
Last active February 11, 2018 14:25
Proper Teardown event handler when we use bind function
import Ember from 'ember';
export default Ember.Component.extend({
exampleProperty: 'example value',
init() {
this._super(...arguments);
},
didInsertElement() {
import Ember from 'ember';
export default Ember.Component.extend({
hasName: Ember.computed.notEmpty('name'),
actions: {
log(message) {
console.log(message);
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
//if you use ()=> instead function() : this reference will be surrounding module when you use arrow function.
result:Ember.computed('model',function(){
return `${this.get('appName')} ${this.get('model')}`;
}),
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Component.extend({
actions:{
onSelect(){
console.log('onSelect in component ');
this.get('onSelect')();
}
}
});