1.0.7 • Published 4 years ago

cplx-alert v1.0.7

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4-rc3

5 years ago

1.0.4-rc2

5 years ago

1.0.4-rc1

5 years ago

1.0.4

5 years ago

1.0.3-rc

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago