core/asset-types/asset-types.realtime.service.ts
AssetTypesRealtimeService is being used to manage a cache of all existing asset types. This service is injected in the AssetOverviewNavigationFactory class, which will trigger the initialization of the cache as the constructor is called.
Methods |
constructor(inventory: InventoryService, appStateService: AppStateService, realtimeSubject: RealtimeSubjectService)
|
||||||||||||
Parameters :
|
getAssetTypeById$ | ||||||||
getAssetTypeById$(assetTypeId: string)
|
||||||||
Returns an asset type from the cache based on the id.
Parameters :
Returns :
Observable<AssetType>
IManagedObject which represents the asset type. |
getAssetTypeByName$ | ||||||||
getAssetTypeByName$(name: string)
|
||||||||
Returns an asset type from the cache based on the unique name property.
Parameters :
Returns :
Observable<AssetType>
IManagedObject which represents the asset type. |
getAssetTypesCache$ |
getAssetTypesCache$()
|
Returns all the available asset types from the cache.
Returns :
Observable<Record<string, AssetType>>
available asset types. |
getIcon$ | ||||||||
getIcon$(type: string)
|
||||||||
Extracts an icon from an asset type.
Parameters :
Returns :
Observable<string>
Returns an icon for a given asset type. |
refreshCache |
refreshCache()
|
Refreshes the asset types cache
Returns :
void
|