Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juggy/d9fd704bfee4cd41b8927b7bff2a8c0e to your computer and use it in GitHub Desktop.
Save juggy/d9fd704bfee4cd41b8927b7bff2a8c0e to your computer and use it in GitHub Desktop.
const fieldList = [
{ label: 'Foo Fields', fields: [{name: 'foo', selected: false}] },
{ label: 'Bar Fields', fields: [{name: 'bar', selected: true}] }
]
fields: Ember.computed('fieldList.@each.fields', function() {
return this.get("fieldList").mapBy("fields");
}),
enabledFields: Ember.computed("fields", "fields.@each.selected", function(){
return this.get("fields").filterBy("selected");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment