Class Model
publicBase class from which Models can be defined.
import Model, { attr } from '@ember-data/model';
export default class User extends Model {
@attr name;
}
Models are used both to define the static schema for a particular resource type as well as the class to instantiate to present that data from cache.
Methods
- belongsTo
- changedAttributes
- deleteRecord
- destroyRecord
- eachAttribute
- eachRelatedType
- eachRelationship
- eachTransformedAttribute
- hasMany
- inverseFor
- reload
- rollbackAttributes
- save
- serialize
- toString
- typeForRelationship
- unloadRecord
Properties
- adapterError
- attributes
- dirtyType
- errors
- fields
- hasDirtyAttributes
- id
- isDeleted
- isEmpty
- isError
- isLoaded
- isLoading
- isNew
- isReloading
- isSaving
- isValid
- modelName
- relatedTypes
- relationshipNames
- relationships
- relationshipsByName
- store
- transformedAttributes
Events
No documented items