ember-cli-filtertable-inbox-health
Version:
A HTML table with some added controls
15 lines (13 loc) • 470 B
JavaScript
import DS from 'ember-data';
export default DS.Model.extend({
name: DS.attr('string'),
children: DS.hasMany('group', {inverse: 'parent'}),
parent: DS.belongsTo('group', {inverse: 'children'}),
depth: DS.attr('number'),
hasChildren: function() {
return this.get('_data.children.length') > 0 || false;
}.property('_data.children.@each'),
childNum: function() {
return this.get('_data.children.length') || 0;
}.property('_data.children.@each')
});