SnotifyService
All methods return toast SnotifyToast Toast methods creates notifications with different class names
.snotify-${METHOD_NAME}
You can style them as you want. Look more in [advanced section].
Core
simple
type:
FunctionSignature:
(body: string): SnotifyToast (body: string, config: SnotifyToastConfig): SnotifyToast (body: string, title: string): SnotifyToast (body: string, title: string, config: SnotifyToastConfig): SnotifyToast
success
type:
FunctionSignature:
(body: string): SnotifyToast (body: string, config: SnotifyToastConfig): SnotifyToast (body: string, title: string): SnotifyToast (body: string, title: string, config: SnotifyToastConfig): SnotifyToast
info
type:
FunctionSignature:
(body: string): SnotifyToast (body: string, config: SnotifyToastConfig): SnotifyToast (body: string, title: string): SnotifyToast (body: string, title: string, config: SnotifyToastConfig): SnotifyToast
warning
type:
FunctionSignature:
(body: string): SnotifyToast (body: string, config: SnotifyToastConfig): SnotifyToast (body: string, title: string): SnotifyToast (body: string, title: string, config: SnotifyToastConfig): SnotifyToast
error
type:
FunctionSignature:
(body: string): SnotifyToast (body: string, config: SnotifyToastConfig): SnotifyToast (body: string, title: string): SnotifyToast (body: string, title: string, config: SnotifyToastConfig): SnotifyToast
confirm
type:
FunctionSignature:
(body: string): SnotifyToast (body: string, config: SnotifyToastConfig): SnotifyToast (body: string, title: string): SnotifyToast (body: string, title: string, config: SnotifyToastConfig): SnotifyToastToast notification with buttons
Example - here
prompt
type:
FunctionSignature:
(body: string): SnotifyToast (body: string, config: SnotifyToastConfig): SnotifyToast (body: string, title: string): SnotifyToast (body: string, title: string, config: SnotifyToastConfig): SnotifyToastToast notification with buttons and input field Example - here
async
type:
FunctionSignature:
(body: string, action: Promise<Snotify> | Observable<Snotify>): SnotifyToast (body: string, title: string, action: Promise<Snotify> | Observable<Snotify>): SnotifyToast (body: string, action: Promise<Snotify> | Observable<Snotify>, config: SnotifyToastConfig): SnotifyToast (body: string, title: string, action: Promise<Snotify> | Observable<Snotify>, config: SnotifyToastConfig): SnotifyToastToast notification of style - info and loading spinner. It changes style depending on complete or error
Observable.
Example - here
html
type:
FunctionSignature:
html(html: string | SafeHtml, config?: SnotifyToastConfig): SnotifyToastToast notification of custom style(default - Simple). Renders your html string inside
.snotifyToast__innerExample - here
Other
setDefaults
type:
FunctionSignature:
( defaults: SnotifyDefaults ) => SnotifyDefaultsSet global configuration object
get
type:
FunctionSignature:
( id: number ) => SnotifyToastSnotifyToast Returns SnotifyToast object by id
remove
type:
FunctionSignature:
( id?: number, remove?: boolean ) => voidIf id passed, removes toast instantly. If no param passed it's the same as clear().
If you want to remove toast instantly passtrueas second argument
clear
type:
FunctionSignature:
() => voidClear notifications array instantly
create
type:
FunctionSignature:
( snotify: Snotify ) => SnotifyToastSnotify
SnotifyToast
Creates custom notification object
button
type:
FunctionSignature:
( text: string, closeOnClick: boolean = true, action: (toast?: SnotifyToast) => void = null, bold: boolean = false ) => SnotifyButtonSnotifyButton
SnotifyToast
Button create helper