File

core/asset-types/asset-types.service.ts

Description

AssetTypesService 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.

Index

Methods

Constructor

constructor(inventory: InventoryService, apiService: ApiService, appStateService: AppStateService)
Parameters :
Name Type Optional
inventory InventoryService No
apiService ApiService No
appStateService AppStateService No

Methods

getAssetTypeById
getAssetTypeById(assetTypeId: string)

Returns an asset type from the cache based on the id.

Parameters :
Name Type Optional Description
assetTypeId string No

Id of the asset type.

Returns : IManagedObject

IManagedObject which represents the asset type.

getAssetTypeByName
getAssetTypeByName(name: string)

Returns an asset type from the cache based on the unique name property.

Parameters :
Name Type Optional Description
name string No

Name of the asset type.

Returns : IManagedObject

IManagedObject which represents the asset type.

getAssetTypesCache
getAssetTypesCache()

Returns all the available asset types from the cache.

available asset types.

Async getIcon
getIcon(type: string)

Extracts an icon from an asset type.

Parameters :
Name Type Optional Description
type string No

Type of the asset type.

Returns : Promise<string>

Returns an icon for a given asset type.

Async initAssetTypesCache
initAssetTypesCache()

Queries available asset types and adds every asset type to the local cache.

Returns : Promise<IManagedObject[]>

IManagedObject table of asset types.

results matching ""

    No results matching ""