DaffInMemoryBackendCategoryService
An in-memory service that mocks out the backend services for getting categories. See the angular in memory documentation for more details.
import { DaffInMemoryBackendCategoryService } from '@daffodil/category/driver/in-memory'
@Injectable()
class DaffInMemoryBackendCategoryService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {
readonly collectionName: DAFF_CATEGORY_IN_MEMORY_COLLECTION_NAME
protected _root: DaffCategory
protected _categories: DaffCategory[]
protected _categoryPageMetadata: DaffCategoryPageMetadata
get rootCategory(): DaffCategory
get categories(): DaffCategory[]
get categoryPageMetadata(): DaffCategoryPageMetadata
get(reqInfo: any)
protected getTotalPages(
allIds: string[]
pageSize: number
)
protected trimProductIdsToSinglePage(
allIds: any[]
currentPage: number
pageSize: number
)
protected generatePageSize(reqInfo)
protected getCurrentPageParam(reqInfo)
}
Properties
Name | Type | Description |
---|---|---|
collectionName | DAFF_CATEGORY_IN_MEMORY_COLLECTION_NAME | |
_root | DaffCategory | |
_categories | DaffCategory[] | |
_categoryPageMetadata | DaffCategoryPageMetadata | |
rootCategory | DaffCategory | |
categories | DaffCategory[] | The collection of categories in the backend. |
categoryPageMetadata | DaffCategoryPageMetadata | The metadata associated with the current page. |
get | Get a category. |
|
getTotalPages | ||
trimProductIdsToSinglePage | ||
generatePageSize | ||
getCurrentPageParam |