Skip to content

Instantly share code, notes, and snippets.

@yatinranadive
Last active March 3, 2017 18:31
Show Gist options
  • Save yatinranadive/dac48521ca750a0d99e1390a0ba7036f to your computer and use it in GitHub Desktop.
Save yatinranadive/dac48521ca750a0d99e1390a0ba7036f to your computer and use it in GitHub Desktop.
Another update
import Ember from 'ember';
export default Ember.Component.extend({
_test: undefined,
init() {
this._super(...arguments);
if (!this.get('_test.value')) {
this.set('_test', {
value: (new Date())
});
} else {
this.set('cached', 'Sample');
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
arr: [1,2,3]
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
{{#each arr as |temp|}}
{{my-component}}
{{/each}}
<br>
<br>
{{yield}}
{{#if cached}}
{{cached}}
{{else}}
This is a test component. {{_test.value}}
{{/if}}
{
"version": "0.11.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": "2.10.2",
"ember-data": "2.11.0",
"ember-template-compiler": "2.10.2",
"ember-testing": "2.10.2"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment