-
Notifications
You must be signed in to change notification settings - Fork 1
DatastoreConfig
Mihael Safaric edited this page Sep 27, 2024
·
7 revisions
A decorator used for configuring a datastore service. It takes one argument, DatastoreOptions
-
network
:NetworkConfig
- see NetworkConfig
- global network configuration
- default values here
-
halDocumentClass
- sets a class on a datastore level which will be used instead of default
HalDocument
class (if not provided on a model level)
- sets a class on a datastore level which will be used instead of default
-
paginationClass
- mandatory, an instance of that class will be created while creating
HalDocument
instance
- mandatory, an instance of that class will be created while creating
-
cacheStrategy
:CacheStrategy
- optional
- defines which caching stragery should be used
- possible values
- default:
CacheStrategy.NONE
- for more information see Caching Strategies
- when
CacheStrategy.CUSTOM
,storage
property must be provided
-
storage
:HalStorage
- required when
cacheStrategy
is set toCacheStrategy.CUSTOM
- see Custom Local Storage guide
- required when
import { HttpClient } from '@angular/common/http';
import { DatastoreService, DatastoreConfig } from 'ngx-hal';
@DatastoreConfig({
network: {
baseUrl: 'mydomain.com'
},
paginationClass: MyPagination
})
export class HalDatastoreService extends DatastoreService<MyPagination> {
constructor(public httpClient: HttpClient) {
super(httpClient);
}
}