mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-09 05:50:08 +00:00
46 lines
962 B
TypeScript
46 lines
962 B
TypeScript
import { Injectable } from '@angular/core'
|
|
import { ToasterService } from 'angular2-toaster'
|
|
|
|
@Injectable()
|
|
export class NotifyService {
|
|
constructor (
|
|
private toaster: ToasterService,
|
|
) {}
|
|
|
|
pop (options) {
|
|
this.toaster.pop(options)
|
|
}
|
|
|
|
info (title: string, body: string = null) {
|
|
return this.pop({
|
|
type: 'info',
|
|
title, body,
|
|
timeout: 4000,
|
|
})
|
|
}
|
|
|
|
success (title: string, body: string = null) {
|
|
return this.pop({
|
|
type: 'success',
|
|
title, body,
|
|
timeout: 4000,
|
|
})
|
|
}
|
|
|
|
warning (title: string, body: string = null) {
|
|
return this.pop({
|
|
type: 'warning',
|
|
title, body,
|
|
timeout: 4000,
|
|
})
|
|
}
|
|
|
|
error (title: string, body: string = null) {
|
|
return this.pop({
|
|
type: 'error',
|
|
title, body,
|
|
timeout: 4000,
|
|
})
|
|
}
|
|
}
|