mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-25 22:09:53 +00:00
47 lines
957 B
TypeScript
47 lines
957 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,
|
|
})
|
|
}
|
|
}
|