Skip to content

Instantly share code, notes, and snippets.

@thousand
Last active August 17, 2016 01:27
Show Gist options
  • Save thousand/190a02539b088e38465ddc3a6c5ba8a9 to your computer and use it in GitHub Desktop.
Save thousand/190a02539b088e38465ddc3a6c5ba8a9 to your computer and use it in GitHub Desktop.
indeterminate component
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Component.extend({
state: 'first',
subComp: Ember.computed('state', function () {
return `component-the-${this.get('state')}`;
}),
init() {
this._super(...arguments);
setTimeout(this.bumpState.bind(this), 1000);
},
bumpState() {
this.set('state', 'second');
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<h1>Welcome to {{appName}}</h1>
{{main-component
state="first"
}}
Component
{{component subComp}}
{
"version": "0.10.4",
"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.7.0",
"ember-data": "2.7.0",
"ember-template-compiler": "2.7.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment