projects/congarevenuecloud/elements/src/shared/services/exception.service.ts
The service is used to show the toaster message based on the message type.
import { ExceptionService, AObjectService} from '@congarevenuecloud/ecommerce';
export class MyComponent implements OnInit{
constructor( private exceptionService: ExceptionService)
}
// or
export class MyService extends AObjectService {
private exceptionService: ExceptionService = this.injector.get(ExceptionService);
}
Methods |
constructor(cartService: CartService, secondaryCartService: SecondaryCartService, constraintRuleService: ConstraintRuleService, promotionService: PromotionService, toastr: ToastrService, translateService: TranslateService, apiService: ApiService)
|
||||||||||||||||||||||||
|
Parameters :
|
| clearToast |
clearToast()
|
|
Clear all toaster. Example:
Returns :
void
|
| showError | ||||||||||||||||||||||||||||||||||||||||
showError(error: CartError | Error | string, title: string, data?: any, positionClass: ToasterPosition, timeOut: number, closeButton: boolean, disableTimeOut: boolean)
|
||||||||||||||||||||||||||||||||||||||||
|
Show error message in the toaster. Example:key which updates whenever language change.
Parameters :
Returns :
void
|
| showInfo | ||||||||||||||||||||||||||||||||||||||||||||||||||
showInfo(message: string, title: string, data?: any, positionClass: ToasterPosition, timeOut: number, closeButton: boolean, disableTimeOut: boolean, progressBar: boolean, tapToDismiss: boolean)
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
Show info message in the toaster. Example:key which updates whenever language change.
Parameters :
Returns :
void
|
| showSuccess | ||||||||||||||||||||||||||||||||||||||||
showSuccess(message: string, title: string, data?: any, positionClass: ToasterPosition, timeOut: number, closeButton: boolean, disableTimeOut: boolean)
|
||||||||||||||||||||||||||||||||||||||||
|
Show success message in the toaster. Example:key which updates whenever language change.
Parameters :
Returns :
void
|
| showWarning | ||||||||||||||||||||||||||||||||||||||||
showWarning(message: string, title: string, data?: any, positionClass: ToasterPosition, timeOut: number, closeButton: boolean, disableTimeOut: boolean)
|
||||||||||||||||||||||||||||||||||||||||
|
Show warning message in the toaster. Example:key which updates whenever language change.
Parameters :
Returns :
void
|