gx-cust-toast v0.0.3
CustToast
This library was generated with Angular CLI version 14.0.0.
Code scaffolding
Run ng generate component component-name --project cust-toast
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project cust-toast
.
Note: Don't forget to add
--project cust-toast
or else it will be added to the default project in yourangular.json
file.
Build
Run ng build cust-toast
to build the project. The build artifacts will be stored in the dist/
directory.
Publishing
After building your library with ng build cust-toast
, go to the dist folder cd dist/cust-toast
and run npm publish
.
Running unit tests
Run ng test cust-toast
to execute the unit tests via Karma.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.
Install
npm i gx-cust-toast
Use
import { CustToastModule } from 'gx-cust-toast'; Add CustToastModule to imports in module.ts
Add tag <lib-cust-toast toast="toast"> Provide the value of toast.
Properties of Toast
Properties | Type | Value
message | string | "Hi Team!"
toastPosition | string | top-right | top-left | top-full-width | bot-right | bot-left | bot-full-width |
bot-center| top-center
showProgressBar | boolean | true | false
toastType | string | Success | Info | Warning | Error
toastColor | string | "#ffffff"
textColor | string | "#ffffff"
iconColor | string | "#ffffff"
iconBackgroundColor | string | "#ffffff"
titleColor | string | "#ffffff"
progressBarColor | string | "#ffffff"
tapToDissmiss | boolean | true | false
closeButton | boolean | true | false
timeout(in ms) | number | 5000
disableTimeout | boolean | true | false
iconClass | string | "bi bi-check-lg"
Example
this.toast= { message: "Hi, Team!", toastPosition:"top-right", showProgressBar:true, toastType:"Success", toastColor:"#E9EDF6", textColor:"grey", tapToDissmiss:true, closeButton:true, timeout:5000, disableTimeout:false, iconBackgroundColor:"blue", iconColor:"#ffffff", titleColor:"blue", progressBarColor:"blue", iconClass:"bi bi-check-lg" }