Data Service (opendash/services/data)

The data service allows you to pull data from all registered data adapters at the same time.


Use the Data Service by injecting opendash/services/data as an Angular Service. We suggest using $data as a name for the variable.


class controller {

  static get $inject() { return ['opendash/services/data']; }

  constructor($data) {
    // ...

Properties & Methods


Returns all open.DASH data items.

let items = $data.list();


Returns an Array containing all instances of OpenDashDataItem and OpenDashDataContainer.

$data.listByType(type: String)

Returns all open.DASH data items.

let items = $data.listByType('Number');

items.forEach(i => {
  let [item, index] = i;

  item.value.values[index]; // A numeric value


  • type: One of the following Strings: Number, String, Boolean, Geo, Object


Returns an two dimensional Arrays where the inner Array has two Elements. The first is a instance of OpenDashDataItem, the second one is the index of the requested value type.

The same instance of OpenDashDataItem my be returned multiple times, if the value uses the requested value type multiple times.


Returns a query.

let items = $data.list();


Returns an instances of OpenDashDataQuery.

$data.get(id: String)

Returns a single open.DASH data item.

let item = $'');

if(!item) {
  // handle missing item


Returns an instance of OpenDashDataItem if there is an item with the given id, if not null is returned.

results matching ""

    No results matching ""