Created
August 24, 2016 14:06
-
-
Save richmolj/73ab1d8875f978ad4d591d78d074639f to your computer and use it in GitHub Desktop.
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
const fieldList = [ | |
{ label: 'Foo Fields', fields: [{name: 'foo', selected: false}] }, | |
{ label: 'Bar Fields', fields: [{name: 'bar', selected: true}] } | |
] | |
fields: Ember.computed('fieldList.@each', function() { | |
let fields = [] | |
this.get('fieldList').forEach((config) => { | |
config.get('fields').forEach((field) => { | |
fields.push(field); | |
}); | |
}); | |
return fields; | |
}), | |
enabledFields: Ember.computed.filterBy('fields', 'selected', true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment