cplx-alert
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

Instalación

Componente global de alertas.

Installation

Install the dependencies and devDependencies and start the server.

$ npm install cplx-alert
$ npm install font-awesome
$ npm install bootstrap

Uso

Importar en app.module.ts

Primero:

imports: [
     CplxAlertModule.forRoot()
]

Luego agregar CplxAlertService como provider en app.module.ts:

providers: [CplxAlertService]

Importar en componente

constructor(private _sms: CplxAlertService) { }
 
//[timout] default 5000
 
timeclose = 10000; // 10 seconds
 
 
/**
* @param tipo {1=success,2=danger,3=warning,4=info}
*/
go_alert(tipo) {
    this._sms.add({ tipo: tipo, mensaje: "Mensaje de prueba " +Math.random() })
}

Selector global en app.component.html

<button (click)="go_alert(1)" class="btn btn-success mx-2">Alert success </button>
<button (click)="go_alert(2)" class="btn btn-danger mx-2">Alert danger </button>
<button (click)="go_alert(4)" class="btn btn-info mx-2">Alert info </button>
<button (click)="go_alert(3)" class="btn btn-warning mx-2">Alert warning </button>
 
<cplx-alert [timeout]="timeclose"></cplx-alert>

Author

  • Efrain Figueroa

License

MIT

Package Sidebar

Install

npm i cplx-alert

Weekly Downloads

2

Version

1.0.7

License

MIT

Unpacked Size

201 kB

Total Files

26

Last publish

Collaborators

  • kowalski-developer