Skip to content

DatastoreConfig

Mihael Safaric edited this page Jul 15, 2019 · 7 revisions

A decorator used for configuring a datastore service. It takes one argument, DatastoreOptions

Options

  • network: NetworkConfig

  • halDocumentClass

    • sets a class on a datastore level which will be used instead of default HalDocument class (if not provided on a model level)
  • paginationClass

    • if provided, an instance of that class will be created while creating HalDocument instance
  • cacheStrategy: CacheStrategy

Example

import { HttpClient } from '@angular/common/http';
import { DatastoreService, DatastoreConfig } from 'ngx-hal';

@DatastoreConfig({
  network: {
    baseUrl: 'mydomain.com'
  }
})
export class HalDatastoreService extends DatastoreService {
  constructor(public httpClient: HttpClient) {
    super(httpClient);
  }
}