flash-text
v1.1.0
Published
Simple Flash box for angular2 and above versions.
Downloads
44
Maintainers
Readme
Flash-Text
The simplest flash implementation for Angular2 and above versions.
Installation
Run npm install flash-text to to install the package.
Implemtation
import { FlashModule } from 'flash-text'
add in app.module.ts and add inject FlashModule
in imports array
Next
import { FlashService } from 'flash-text'
in your component and add FlashService
instance in your constructor like
constuctor(private _flashService:FlashService){}
Next send data to the flash
Eg: this._flashService.request({type:'welcome', message:'Welcome message from flash-text', class:'flash-success'})
here request method accepts an object with below key and values
{type: 'welcome', // which is refer to you flash id
message: 'welcome message from flash', //message that you want to display in flash
class: 'flash-success', // tells the status of flash message it may also contain 1) flash-success, 2) flash-danger, 3) flash-warning, 4) flash-default
}
Include flash id in your view
<flash type="welcome"></flash>
THE END Thank you have some with code :)