Last active
September 19, 2016 20:34
-
-
Save sbatson5/b8c83a5dad5a30337e6e31b7ad92b1d8 to your computer and use it in GitHub Desktop.
Input id not updating
This file contains 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'; | |
const { computed, get, set } = Ember; | |
export default Ember.Component.extend({ | |
inputId: computed('index', 'todo.{course,completed}', { | |
get() { | |
return `${get(this, 'todo.course')}__${get(this, 'index')}`; | |
} | |
}), | |
actions: { | |
completeTodo() { | |
set(this, 'todo.complete', true); | |
} | |
} | |
}); |
This file contains 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', | |
todos: [ | |
{ | |
description: 'abc', | |
complete: false | |
}, { | |
description: '123', | |
complete: false | |
} | |
], | |
completeTodos: Ember.computed.filterBy('todos', 'complete', true), | |
incompleteTodos: Ember.computed.filterBy('todos', 'complete', false) | |
}); |
This file contains 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'; | |
const { computed: { filterBy } } = Ember; | |
export default Ember.Controller.extend({ | |
todos: [ | |
{ | |
description: 'abc', | |
course: 'English', | |
complete: false | |
}, { | |
description: '123', | |
course: 'English', | |
complete: false | |
} | |
], | |
completeTodos: filterBy('todos', 'complete', true), | |
incompleteTodos: filterBy('todos', 'complete', false) | |
}); |
This file contains 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.Route.extend({ | |
}); |
This file contains 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.10.5", | |
"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.8.0", | |
"ember-data": "2.8.0", | |
"ember-template-compiler": "2.8.0", | |
"ember-testing": "2.8.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment