@railinc/rl-toasty
v0.0.4
Published
rl-toasty shows alerts and messages for your Angular application. It is a service that sets the default configuration for ng2-toasty and simplifies the API of ng2-toasty.
Downloads
14
Keywords
Readme
rl-toasty
rl-toasty shows alerts and messages for your Angular application. It is a service that sets the default configuration for ng2-toasty and simplifies the API of ng2-toasty.
Installation
To install this library, run:
$ npm install @railinc/rl-toasty --save
Usage
You can import rl-toasty in any Angular application:
and then from your component:
import { RlToastyService } from '@railinc/rl-toasty';
@Component({
selector: 'your-component',
templateUrl: './your-component.html'
})
export class YourComponent {
constructor(private rlToastyService: RlToastyService) {}
addToast() {
// Add all possible types in one shot
this.rlToastyService.addToast('info', 'Your info message');
this.rlToastyService.addToast('success', 'Your success message');
this.rlToastyService.addToast('error', 'Your error message');
this.rlToastyService.addToast('warning', 'Your warning message');
}
}
Once your library is imported, you can use it in your Angular application:
Development
To generate all *.js
, *.js.map
and *.d.ts
files:
$ npm run tsc
To lint all *.ts
files:
$ npm run lint
License
MIT © Bruce Gong