Generator API

generateServices

Generate Angular $resource services for the given loopback application.

var generateServices = require('loopback-sdk-angular').services;
var app = require('./server/server');

var client = generateServices(app, 'lbServices', '/api');
require('fs').writeFileSync('client/loopback.js', client, 'utf-8');
Arguments
Name Type Description
app Object

The loopback application created via app = loopback().

ngModuleName string

A name for the generated Angular module. Default: lbServices.

apiUrl string

The URL where the client can access the LoopBack server app. Default: /.

Returns
Name Type Description
result string

The generated javascript code.

Angular Client API

Class: AccessToken

A $resource object for interacting with the AccessToken model.

Example

See $resource for an example of using this object.

Class: AccessToken Static Methods

AccessToken.count(parameters, successCb, errorCb)

Count instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • count{number=} -

AccessToken.create(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a AccessToken object.)

AccessToken.createChangeStream(parameters, postData, successCb, errorCb)

Create a change stream.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data.

  • options{object=} -
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • changes{ReadableStream=} -

AccessToken.createMany(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a AccessToken object.)

AccessToken.deleteById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

AccessToken.destroyById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

AccessToken.exists(parameters, successCb, errorCb)

Check whether a model instance exists in the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • exists{boolean=} -

AccessToken.find(parameters, successCb, errorCb)

Find all instances of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a AccessToken object.)

AccessToken.findById(parameters, successCb, errorCb)

Find a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id

  • filter{object=} - Filter defining fields and include

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a AccessToken object.)

AccessToken.findOne(parameters, successCb, errorCb)

Find first instance of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a AccessToken object.)

AccessToken.prototype$updateAttributes(parameters, postData, successCb, errorCb)

Update attributes for a model instance and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a AccessToken object.)

AccessToken.removeById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

AccessToken.update(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

AccessToken.updateAll(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

AccessToken.updateOrCreate(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a AccessToken object.)

AccessToken.upsert(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a AccessToken object.)

AccessToken.user(parameters, successCb, errorCb)

Fetches belongsTo relation user.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id

  • refresh{boolean=} -

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a User object.)

Class: ACL

A $resource object for interacting with the ACL model.

Example

See $resource for an example of using this object.

Class: ACL Static Methods

ACL.count(parameters, successCb, errorCb)

Count instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • count{number=} -

ACL.create(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a ACL object.)

ACL.createChangeStream(parameters, postData, successCb, errorCb)

Create a change stream.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data.

  • options{object=} -
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • changes{ReadableStream=} -

ACL.createMany(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a ACL object.)

ACL.deleteById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

ACL.destroyById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

ACL.exists(parameters, successCb, errorCb)

Check whether a model instance exists in the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • exists{boolean=} -

ACL.find(parameters, successCb, errorCb)

Find all instances of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a ACL object.)

ACL.findById(parameters, successCb, errorCb)

Find a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id

  • filter{object=} - Filter defining fields and include

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a ACL object.)

ACL.findOne(parameters, successCb, errorCb)

Find first instance of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a ACL object.)

ACL.prototype$updateAttributes(parameters, postData, successCb, errorCb)

Update attributes for a model instance and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a ACL object.)

ACL.removeById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

ACL.update(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

ACL.updateAll(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

ACL.updateOrCreate(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a ACL object.)

ACL.upsert(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a ACL object.)

Class: Application

A $resource object for interacting with the Application model.

Example

See $resource for an example of using this object.

Class: Application Static Methods

Application.count(parameters, successCb, errorCb)

Count instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • count{number=} -

Application.create(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Application object.)

Application.createChangeStream(parameters, postData, successCb, errorCb)

Create a change stream.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data.

  • options{object=} -
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • changes{ReadableStream=} -

Application.createMany(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Application object.)

Application.deleteById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Application.destroyById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Application.exists(parameters, successCb, errorCb)

Check whether a model instance exists in the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • exists{boolean=} -

Application.find(parameters, successCb, errorCb)

Find all instances of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Application object.)

Application.findById(parameters, successCb, errorCb)

Find a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id

  • filter{object=} - Filter defining fields and include

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Application object.)

Application.findOne(parameters, successCb, errorCb)

Find first instance of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Application object.)

Application.prototype$updateAttributes(parameters, postData, successCb, errorCb)

Update attributes for a model instance and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Application object.)

Application.removeById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Application.update(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Application.updateAll(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Application.updateOrCreate(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Application object.)

Application.upsert(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Application object.)

Class: Change

A $resource object for interacting with the Change model.

Example

See $resource for an example of using this object.

Class: Change Static Methods

Change.count(parameters, successCb, errorCb)

Count instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • count{number=} -

Change.create(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Change object.)

Change.createChangeStream(parameters, postData, successCb, errorCb)

Create a change stream.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data.

  • options{object=} -
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • changes{ReadableStream=} -

Change.createMany(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Change object.)

Change.deleteById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Change.destroyById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Change.exists(parameters, successCb, errorCb)

Check whether a model instance exists in the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • exists{boolean=} -

Change.find(parameters, successCb, errorCb)

Find all instances of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Change object.)

Change.findById(parameters, successCb, errorCb)

Find a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id

  • filter{object=} - Filter defining fields and include

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Change object.)

Change.findOne(parameters, successCb, errorCb)

Find first instance of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Change object.)

Change.prototype$updateAttributes(parameters, postData, successCb, errorCb)

Update attributes for a model instance and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Change id
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Change object.)

Change.removeById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Change.update(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Change.updateAll(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Change.updateOrCreate(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Change object.)

Change.upsert(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Change object.)

Class: Checkpoint

A $resource object for interacting with the Checkpoint model.

Example

See $resource for an example of using this object.

Class: Checkpoint Static Methods

Checkpoint.count(parameters, successCb, errorCb)

Count instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • count{number=} -

Checkpoint.create(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Checkpoint object.)

Checkpoint.createChangeStream(parameters, postData, successCb, errorCb)

Create a change stream.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data.

  • options{object=} -
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • changes{ReadableStream=} -

Checkpoint.createMany(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Checkpoint object.)

Checkpoint.deleteById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Checkpoint.destroyById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Checkpoint.exists(parameters, successCb, errorCb)

Check whether a model instance exists in the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • exists{boolean=} -

Checkpoint.find(parameters, successCb, errorCb)

Find all instances of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Checkpoint object.)

Checkpoint.findById(parameters, successCb, errorCb)

Find a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id

  • filter{object=} - Filter defining fields and include

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Checkpoint object.)

Checkpoint.findOne(parameters, successCb, errorCb)

Find first instance of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Checkpoint object.)

Checkpoint.prototype$updateAttributes(parameters, postData, successCb, errorCb)

Update attributes for a model instance and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Checkpoint object.)

Checkpoint.removeById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Checkpoint.update(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Checkpoint.updateAll(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Checkpoint.updateOrCreate(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Checkpoint object.)

Checkpoint.upsert(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Checkpoint object.)

Class: Email

A $resource object for interacting with the Email model.

Example

See $resource for an example of using this object.

Class: LoopBackResourceProvider

Use LoopBackResourceProvider to change the global configuration settings used by all models. Note that the provider is available to Configuration Blocks only, see Module Loading & Dependencies for more details.

Example

angular.module('app')
 .config(function(LoopBackResourceProvider) {
    LoopBackResourceProvider.setAuthHeader('X-Access-Token');
 });

Class: LoopBackResourceProvider Static Methods

LoopBackResourceProvider.getUrlBase

Get the URL of the REST API server. The URL provided to the code generator (lb-ng or grunt-loopback-sdk-angular) is used.

LoopBackResourceProvider.setAuthHeader(header)

Configure the REST transport to use a different header for sending the authentication token. It is sent in the Authorization header by default.

Arguments
Name Type Description
header string

The header name to use, e.g. X-Access-Token

LoopBackResourceProvider.setUrlBase(url)

Change the URL of the REST API server. By default, the URL provided to the code generator (lb-ng or grunt-loopback-sdk-angular) is used.

Arguments
Name Type Description
url string

The URL to use, e.g. /api or //example.com/api.

Class: Role

A $resource object for interacting with the Role model.

Example

See $resource for an example of using this object.

Class: Role Static Methods

Role.count(parameters, successCb, errorCb)

Count instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • count{number=} -

Role.create(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Role object.)

Role.createChangeStream(parameters, postData, successCb, errorCb)

Create a change stream.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data.

  • options{object=} -
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • changes{ReadableStream=} -

Role.createMany(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Role object.)

Role.deleteById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Role.destroyById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Role.exists(parameters, successCb, errorCb)

Check whether a model instance exists in the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • exists{boolean=} -

Role.find(parameters, successCb, errorCb)

Find all instances of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Role object.)

Role.findById(parameters, successCb, errorCb)

Find a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id

  • filter{object=} - Filter defining fields and include

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Role object.)

Role.findOne(parameters, successCb, errorCb)

Find first instance of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Role object.)

Role.prototype$updateAttributes(parameters, postData, successCb, errorCb)

Update attributes for a model instance and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Role object.)

Role.removeById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Role.update(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Role.updateAll(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Role.updateOrCreate(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Role object.)

Role.upsert(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Role object.)

Class: Role.principals

The object Role.principals groups methods manipulating RoleMapping instances related to Role.

Call Role.principals() to query all related instances.

Class: Role.principals Static Methods

Role.principals.count(parameters, successCb, errorCb)

Counts principals of Role.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id

  • where{object=} - Criteria to match model instances

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • count{number=} -

Role.principals.create(parameters, postData, successCb, errorCb)

Creates a new instance in principals of this model.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a RoleMapping object.)

Role.principals.createMany(parameters, postData, successCb, errorCb)

Creates a new instance in principals of this model.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a RoleMapping object.)

Role.principals.destroyAll(parameters, successCb, errorCb)

Deletes all principals of this model.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Role.principals.destroyById(parameters, successCb, errorCb)

Delete a related item by id for principals.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id

  • fk{*} - Foreign key for principals

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Role.principals.findById(parameters, successCb, errorCb)

Find a related item by id for principals.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id

  • fk{*} - Foreign key for principals

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a RoleMapping object.)

Role.principals(parameters, successCb, errorCb)

Queries principals of Role.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id

  • filter{object=} -

successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a RoleMapping object.)

Role.principals.updateById(parameters, postData, successCb, errorCb)

Update a related item by id for principals.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id

  • fk{*} - Foreign key for principals

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a RoleMapping object.)

Class: RoleMapping

A $resource object for interacting with the RoleMapping model.

Example

See $resource for an example of using this object.

Class: RoleMapping Static Methods

RoleMapping.count(parameters, successCb, errorCb)

Count instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • count{number=} -

RoleMapping.create(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a RoleMapping object.)

RoleMapping.createChangeStream(parameters, postData, successCb, errorCb)

Create a change stream.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data.

  • options{object=} -
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • changes{ReadableStream=} -

RoleMapping.createMany(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a RoleMapping object.)

RoleMapping.deleteById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

RoleMapping.destroyById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

RoleMapping.exists(parameters, successCb, errorCb)

Check whether a model instance exists in the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • exists{boolean=} -

RoleMapping.find(parameters, successCb, errorCb)

Find all instances of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a RoleMapping object.)

RoleMapping.findById(parameters, successCb, errorCb)

Find a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id

  • filter{object=} - Filter defining fields and include

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a RoleMapping object.)

RoleMapping.findOne(parameters, successCb, errorCb)

Find first instance of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a RoleMapping object.)

RoleMapping.prototype$updateAttributes(parameters, postData, successCb, errorCb)

Update attributes for a model instance and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a RoleMapping object.)

RoleMapping.removeById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

RoleMapping.role(parameters, successCb, errorCb)

Fetches belongsTo relation role.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id

  • refresh{boolean=} -

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Role object.)

RoleMapping.update(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

RoleMapping.updateAll(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

RoleMapping.updateOrCreate(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a RoleMapping object.)

RoleMapping.upsert(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a RoleMapping object.)

Class: Scope

A $resource object for interacting with the Scope model.

Example

See $resource for an example of using this object.

Class: Scope Static Methods

Scope.count(parameters, successCb, errorCb)

Count instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • count{number=} -

Scope.create(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Scope object.)

Scope.createChangeStream(parameters, postData, successCb, errorCb)

Create a change stream.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data.

  • options{object=} -
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • changes{ReadableStream=} -

Scope.createMany(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Scope object.)

Scope.deleteById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Scope.destroyById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Scope.exists(parameters, successCb, errorCb)

Check whether a model instance exists in the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • exists{boolean=} -

Scope.find(parameters, successCb, errorCb)

Find all instances of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Scope object.)

Scope.findById(parameters, successCb, errorCb)

Find a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id

  • filter{object=} - Filter defining fields and include

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Scope object.)

Scope.findOne(parameters, successCb, errorCb)

Find first instance of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Scope object.)

Scope.prototype$updateAttributes(parameters, postData, successCb, errorCb)

Update attributes for a model instance and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - PersistedModel id
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Scope object.)

Scope.removeById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Scope.update(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Scope.updateAll(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

Scope.updateOrCreate(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Scope object.)

Scope.upsert(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a Scope object.)

Class: User

A $resource object for interacting with the User model.

Example

See $resource for an example of using this object.

Class: User Static Methods

User.confirm(parameters, successCb, errorCb)

Confirm a user registration with email verification token.

Arguments
Name Type Description
parameters Object

Request parameters.

  • uid{string} -

  • token{string} -

  • redirect{string=} -

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

User.count(parameters, successCb, errorCb)

Count instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • count{number=} -

User.create(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a User object.)

User.createChangeStream(parameters, postData, successCb, errorCb)

Create a change stream.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data.

  • options{object=} -
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • changes{ReadableStream=} -

User.createMany(parameters, postData, successCb, errorCb)

Create a new instance of the model and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a User object.)

User.deleteById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

User.destroyById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

User.exists(parameters, successCb, errorCb)

Check whether a model instance exists in the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • exists{boolean=} -

User.find(parameters, successCb, errorCb)

Find all instances of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a User object.)

User.findById(parameters, successCb, errorCb)

Find a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id

  • filter{object=} - Filter defining fields and include

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a User object.)

User.findOne(parameters, successCb, errorCb)

Find first instance of the model matched by filter from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • filter{object=} - Filter defining fields, where, include, order, offset, and limit
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a User object.)

User.getCachedCurrent

Get data of the currently logged user that was returned by the last call to User.login or User.getCurrent. Return null when there is no user logged in or the data of the current user were not fetched yet.

Returns
Name Type Description
result Object

A User instance.

User.getCurrent(successCb, errorCb)

Get data of the currently logged user. Fail with HTTP result 401 when there is no user logged in.

Arguments
Name Type Description
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

User.getCurrentId

Returns
Name Type Description
result Object

Id of the currently logged-in user or null.

User.isAuthenticated

Returns
Name Type Description
result boolean

True if the current user is authenticated (logged in).

User.login(parameters, postData, successCb, errorCb)

Login a user with username/email and password.

Arguments
Name Type Description
parameters Object

Request parameters.

  • include{string=} - Related objects to include in the response. See the description of return value for more details. Default value: user.

  • rememberMe - boolean - Whether the authentication credentials should be remembered in localStorage across app/browser restarts. Default: true.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

The response body contains properties of the AccessToken created on login. Depending on the value of include parameter, the body may contain additional properties:

  • user - {User} - Data of the currently logged in user. (include=user)

User.logout(parameters, postData, successCb, errorCb)

Logout a user with access token.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data.

  • access_token{string} - Do not supply this argument, it is automatically extracted from request headers.
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

User.prototype$updateAttributes(parameters, postData, successCb, errorCb)

Update attributes for a model instance and persist it into the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - User id
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a User object.)

User.removeById(parameters, successCb, errorCb)

Delete a model instance by id from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - Model id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

User.resetPassword(parameters, postData, successCb, errorCb)

Reset password for a user with email.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

User.update(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

User.updateAll(parameters, postData, successCb, errorCb)

Update instances of the model matched by where from the data source.

Arguments
Name Type Description
parameters Object

Request parameters.

  • where{object=} - Criteria to match model instances
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

User.updateOrCreate(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a User object.)

User.upsert(parameters, postData, successCb, errorCb)

Update an existing model instance or insert a new one into the data source.

Arguments
Name Type Description
parameters Object

Request parameters. This method does not accept any parameters. Supply an empty object or omit this argument altogether.

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a User object.)

Class: User.accessTokens

The object User.accessTokens groups methods manipulating AccessToken instances related to User.

Call User.accessTokens() to query all related instances.

Class: User.accessTokens Static Methods

User.accessTokens(parameters, successCb, errorCb)

Queries accessTokens of User.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - User id

  • filter{object=} -

successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a AccessToken object.)

User.accessTokens.count(parameters, successCb, errorCb)

Counts accessTokens of User.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - User id

  • where{object=} - Criteria to match model instances

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

Data properties:

  • count{number=} -

User.accessTokens.create(parameters, postData, successCb, errorCb)

Creates a new instance in accessTokens of this model.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - User id
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a AccessToken object.)

User.accessTokens.createMany(parameters, postData, successCb, errorCb)

Creates a new instance in accessTokens of this model.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - User id
postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Array.<Object>, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Array.<Object>

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a AccessToken object.)

User.accessTokens.destroyAll(parameters, successCb, errorCb)

Deletes all accessTokens of this model.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - User id
successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

User.accessTokens.destroyById(parameters, successCb, errorCb)

Delete a related item by id for accessTokens.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - User id

  • fk{*} - Foreign key for accessTokens

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

This method returns no data.

User.accessTokens.findById(parameters, successCb, errorCb)

Find a related item by id for accessTokens.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - User id

  • fk{*} - Foreign key for accessTokens

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a AccessToken object.)

User.accessTokens.updateById(parameters, postData, successCb, errorCb)

Update a related item by id for accessTokens.

Arguments
Name Type Description
parameters Object

Request parameters.

  • id{*} - User id

  • fk{*} - Foreign key for accessTokens

postData Object

Request data. This method expects a subset of model properties as request parameters.

successCb function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb function(Object)

Error callback with one argument: httpResponse.

Returns
Name Type Description
result Object

An empty reference that will be populated with the actual data once the response is returned from the server.

(The remote method definition does not provide any description. This usually means the response is a AccessToken object.)