Last active
July 24, 2018 20:30
-
-
Save phillipkregg/5c3224fa447b0cd39089320affd9a789 to your computer and use it in GitHub Desktop.
Check Boxes
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', | |
testArray: [ | |
Ember.Object.create({name: 'first', isChecked: true}), | |
Ember.Object.create({name: 'second', isChecked: true}), | |
Ember.Object.create({name: 'third', isChecked: true}), | |
Ember.Object.create({name: 'fourth', isChecked: true}) | |
], | |
actions: { | |
toggleChecked() { | |
var testArray = this.get('testArray'); | |
var i; | |
for (i=0; i < testArray.length; i++) { | |
if (testArray[i].isChecked) { | |
testArray[i].set('isChecked', false); | |
} else { | |
testArray[i].set('isChecked', 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
{ | |
"version": "0.15.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.2.2", | |
"ember-template-compiler": "3.2.2", | |
"ember-testing": "3.2.2" | |
}, | |
"addons": { | |
"ember-data": "3.2.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment