Skip to content

Instantly share code, notes, and snippets.

@ofridagan
Created January 18, 2016 14:31
Show Gist options
  • Save ofridagan/f30a14df57376ff58037 to your computer and use it in GitHub Desktop.
Save ofridagan/f30a14df57376ff58037 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
let i=0;
export default Ember.Controller.extend({
appName:'Ember Twiddle',
xxx: (function() {
return new Ember.RSVP.Promise(function(r){r(i++)});
}).property('appName'),
yyy: (function() {
return Ember.guidFor(this.get('xxx'));
}).property('xxx'),
init: function() {
let _this = this
Ember.run.later(this, function(){
this.get('xxx').then(function(v){
_this.set('appName', v);
_this.init();
})}, 1000);
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{yyy}}
{{outlet}}
<br>
<br>
{
"version": "0.5.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "1.13.11",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.2.0/ember-data.js",
"ember-template-compiler": "1.13.11"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment