Created
May 9, 2016 18:27
-
-
Save MiguelMadero/440fde853203357a13a8d184e66602d3 to your computer and use it in GitHub Desktop.
FilterBy for Kevin
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'; | |
var people = [{name: 'Miguel', isActive: false}, {name: 'Kevin', isActive: true}]; | |
var resolve; | |
var promise = new Ember.RSVP.Promise(function (reject, resolve) { | |
resolve = resolve; | |
}); | |
resolve(); | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
people: people, | |
usingMacroForPromise: Ember.computed.filterBy('promise', 'isActive', true), | |
usingCP: Ember.computed('people.@each.isActive', function () { | |
return people.filterBy('isActive'); | |
}), | |
actions: { | |
resolve() { | |
resolve(); | |
} | |
} | |
}); |
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.8.0", | |
"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.5.1", | |
"ember-data": "2.5.2", | |
"ember-template-compiler": "2.5.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment