Skip to content

Instantly share code, notes, and snippets.

@joostdevries
Last active April 12, 2016 14:57
Show Gist options
  • Save joostdevries/b30a68cb983a36d8967294c9da7d151c to your computer and use it in GitHub Desktop.
Save joostdevries/b30a68cb983a36d8967294c9da7d151c to your computer and use it in GitHub Desktop.
lf-test
import { task, timeout } from 'ember-concurrency';
export default Ember.Component.extend({
count: 0,
countingTask: task(function * () {
this.set('count', 0);
while (this.count < 5) {
this.incrementProperty('count');
yield timeout(300);
}
this.set('count', "DONE!");
}).restartable()
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
// app/mirage/config.js
export default function() {
this.get('/api/users', function() {
return {
users: [
{ id: 1, name: 'Zelda' },
{ id: 2, name: 'Link' },
{ id: 3, name: 'Epona' },
]
}
});
}
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none'
});
Router.map(function() {
this.route('contact');
});
export default Router;
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{liquid-outlet}}
<button onclick={{perform countingTask}}>Count ({{count}})</button>
<h2>Contact</h2>
<br>
<br>
{{#link-to 'index'}}Home{{/link-to}}
<h2>Home</h2>
<br>
<br>
{{#link-to 'contact'}}Contact{{/link-to}}
<br>
{{my-counter}}
export default function(){
this.transition(
this.use('toLeft'),
this.reverse('toRight')
);
};
{
"version": "0.7.2",
"EmberENV": {
"FEATURES": {}
},
"addons":{
"liquid-fire":"latest",
"ember-bootstrap": "latest",
"ember-concurrency": "latest"
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"babel-pf":"https://cdn.rawgit.com/nicksrandall/babel-polyfill/master/browser-polyfill.js",
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment