projects/congarevenuecloud/elements/src/lib/line-item-table-row/services/user-view-mapping.service.ts
User view mapping service maps the response from user view service to CartItemView interface.
import { UserViewMappingService, AObjectService } from '@congarevenuecloud/ecommerce';
constructor(private mappingService: UserViewMappingService) { }
// or
export class MyService extends AObjectService {
private mappingService: UserViewMappingService = this.injector.get(UserViewMappingService);
}
Properties |
Methods |
constructor(userViewService: UserViewService, userService: UserService)
|
|||||||||
Parameters :
|
getView | ||||||||||||
getView(cartItemView$: BehaviorSubject
|
||||||||||||
Initializes BehaviorSubject containing an array of CartItemView objects. Example:Example :
Parameters :
Returns :
BehaviorSubject<Array<CartItemView>>
A BehaviorSubject containing the array of CartItemView objects. |
saveCartColumnView | ||||||||
saveCartColumnView(cartColumnView: CartColumnView)
|
||||||||
Saves a CartColumnView to a user's view. This function updates the user's view by either adding a new CartColumnView or updating an existing one. Example:Example :
Parameters :
Returns :
Observable<CartColumnView[]>
An Observable emitting an array of CartColumnView object. |
updateUserSelections | ||||||||||||
updateUserSelections(view: Array
|
||||||||||||
This method updates the cart page with cart item fields selected from line item menu component. The changes are available in browser storage and won't be persisted to system. Example:Example :
Parameters :
Returns :
void
|
cartItemMyView$ |
Type : BehaviorSubject<Array<CartItemView>>
|
Default value : new BehaviorSubject(null)
|
Behavior subject containing list of cart item views, for all cart item field selections available on cart page for user specific view. |
cartItemView$ |
Type : BehaviorSubject<Array<CartItemView>>
|
Default value : new BehaviorSubject(null)
|
Behavior subject containing list of cart item views, for all cart item field selections available on cart page. |
selectedItems$ |
Type : BehaviorSubject<Array<CartItemView>>
|
Default value : new BehaviorSubject(null)
|
Behavior subject containing list of cart item views, for the selected cart item fields on cart page. |