Created
February 25, 2018 11:22
-
-
Save Serabe/8dc06244501860b104f6806da3e67fbc to your computer and use it in GitHub Desktop.
New Twiddle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
function logLifeCicle(name) { | |
return function() { | |
console.log(name, ...arguments); | |
}; | |
} | |
export default Ember.Component.extend({ | |
bar: 0, | |
didUpdateAttrs: logLifeCicle('didUpdateAttrs'), | |
didReceiveAttrs: logLifeCicle('didReceiveAttrs'), | |
willUpdate: logLifeCicle('willUpdate'), | |
willRender: logLifeCicle('willRender'), | |
didUpdate: logLifeCicle('didUpdate'), | |
didRender: logLifeCicle('didRender'), | |
actions: { | |
change() { | |
// if comment out this line, mutation will be updated in template properly | |
this.toggleProperty('foo'); | |
this.set('bar', Math.random()); | |
console.log(this.get('bar')); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
foo: true, | |
bar: 0 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model() { | |
return false; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.13.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "release", | |
"ember-template-compiler": "release", | |
"ember-testing": "release" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment