Last active
June 18, 2016 17:26
-
-
Save snewcomer/eefa21f4f6b0a24cca6fd5b6eeaa5aa2 to your computer and use it in GitHub Desktop.
New Twiddle
This file contains hidden or 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.Component.extend({ | |
actions: { | |
complete: function() { | |
this.get('todo').set('isDone', true); | |
this.notifyPropertyChange('todo'); | |
}, | |
/* click on this twice and will show alert. Happens @ some later point in time when the run loop has finished */ | |
destroy: function() { | |
this.get('todo').destroy(); | |
this.notifyPropertyChange('todo'); | |
}, | |
}, | |
remainingTodo: Ember.computed('todo', function () { | |
var todo = this.get('todo'); | |
console.log('notifyPropertyChange worked'); | |
console.log(todo.get('isDone'), todo.get('time')) | |
if (!todo.get('time')) { alert(todo.get('isDone'), todo.get('name')) } | |
return todo.get('time'); | |
}) | |
}); |
This file contains hidden or 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({ | |
appName: 'Ember Twiddle', | |
todo: Ember.Object.create({isDone: false, time: '11 min left'}) | |
}); |
This file contains hidden or 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.9.2", | |
"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.6.0", | |
"ember-data": "2.6.0", | |
"ember-template-compiler": "2.6.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment