Files
threshold-ui/addons/api/addon/models/base.js
T

23 lines
412 B
JavaScript

import Model from '@ember-data/model';
import { computed } from '@ember/object';
export default class BaseModel extends Model {
// =attributes
/**
* @type {boolean}
*/
@computed('hasDirtyAttributes', 'isSaving')
get canSave() {
return this.hasDirtyAttributes && !this.isSaving;
}
/**
* @type {boolean}
*/
@computed('canSave')
get cannotSave() {
return !this.canSave;
}
}