projects/congarevenuecloud/ecommerce/src/lib/modules/catalog/services/category.service.ts
Category allows in organizing products in a way that makes it easy for visitors to find out what they're looking for
import { CategoryService, AObjectService} from '@congarevenuecloud/ecommerce';
export class MyComponent implements OnInit{
constructor( private categoryService: CategoryService)
}
// or
export class MyService extends AObjectService {
private categoryService: CategoryService = this.injector.get(CategoryService);
}
AObjectService
Properties |
|
Methods |
getCategories |
getCategories()
|
The primary method to get all the categories based on pricelist. This is a hot observable that will be updated when the state of the category changes. Example:Example :
Returns :
Observable<Array<Category>>
A hot observable containing the list of categories |
getCategoryBranchChildren | ||||||||
getCategoryBranchChildren(categoryIdList: Array
|
||||||||
This method fetches all the children categories recursively for the category identifiers. Example:Example :
Parameters :
Returns :
Observable<Array<Category>>
an observable containing the array of categories. |
getCategoryByName | ||||||||
getCategoryByName(categoryName: string)
|
||||||||
This method fetches a category by name. It returns a hot observable of the category matching the name. Example:Example :
Parameters :
Returns :
Observable<Category>
A hot observable containing the single category instance. |
Protected plService |
Default value : this.injector.get(PriceListService, 'priceListService')
|
Protected productCategoryService |
Default value : this.injector.get(ProductCategoryService, 'productCategoryService')
|
Protected translatorService |
Default value : this.injector.get(TranslatorLoaderService, 'translatorService')
|
type |
Default value : Category
|