Skip to content

Latest commit

 

History

History
76 lines (67 loc) · 2.15 KB

Basic-model-object.md

File metadata and controls

76 lines (67 loc) · 2.15 KB
title lang layout keywords tags sidebar permalink summary
Basic model object
en
page
LoopBack
lb2_sidebar
/doc/en/lb2/Basic-model-object.html

Overview

By default, the basic LoopBack Model object has properties and methods "mixed in" from:

When you define relations between models, the RelationMixin object object also gets mixed in to the model object.

Events

{% include note.html content="The following events are deprecated in favor of operation hooks:

  • changed
  • deleted
  • deletedAll " %}

The following table summarizes the events that LoopBack models can emit. For more information, see Events.

Event Emitted when... Arguments Argument type Class methods that emit Instance methods that emit
'attached' Model is attached to an app. Model class Object app.model(modelName)  
'dataSourceAttached' Model is attached to a Data source. Model class Object   DataSource.prototype
.createModel
DataSource.prototype
.define
'set' Model property is set. Model instance Object   Model.prototype
.setAttributes()