angular2-notifications

  • Version 12.0.0
  • Published
  • 370 kB
  • 1 dependency
  • MIT license

Install

npm i angular2-notifications
yarn add angular2-notifications
pnpm add angular2-notifications

Overview

> A light and easy to use notifications library for Angular 2. ~~It features both regular page notifications (toasts) and push notifications.~~

Index

Variables

variable OPTIONS

const OPTIONS: InjectionToken<Options>;

    Functions

    function optionsFactory

    optionsFactory: (options: any) => any;

      Classes

      class NotificationComponent

      class NotificationComponent implements OnInit, OnDestroy {}

        constructor

        constructor(
        notificationService: NotificationsService,
        domSanitizer: DomSanitizer,
        cd: ChangeDetectorRef,
        zone: NgZone
        );

          property animate

          animate: NotificationAnimationType;

            property clickIconToClose

            clickIconToClose: boolean;

              property clickToClose

              clickToClose: boolean;

                property content

                content: any;

                  property contentIsTemplate

                  contentIsTemplate: boolean;

                    property htmlIsTemplate

                    htmlIsTemplate: boolean;

                      property item

                      item: Notification;

                        property maxLength

                        maxLength: number;

                          property ɵcmp

                          static ɵcmp: i0.ɵɵComponentDeclaration<
                          NotificationComponent,
                          'simple-notification',
                          never,
                          {
                          timeOut: 'timeOut';
                          showProgressBar: 'showProgressBar';
                          pauseOnHover: 'pauseOnHover';
                          clickToClose: 'clickToClose';
                          clickIconToClose: 'clickIconToClose';
                          maxLength: 'maxLength';
                          theClass: 'theClass';
                          rtl: 'rtl';
                          animate: 'animate';
                          position: 'position';
                          item: 'item';
                          },
                          {},
                          never,
                          never
                          >;

                            property ɵfac

                            static ɵfac: i0.ɵɵFactoryDeclaration<NotificationComponent, never>;

                              property pauseOnHover

                              pauseOnHover: boolean;

                                property position

                                position: number;

                                  property progressWidth

                                  progressWidth: number;

                                    property rtl

                                    rtl: boolean;

                                      property safeInputHtml

                                      safeInputHtml: SafeHtml;

                                        property safeSvg

                                        safeSvg: SafeHtml;

                                          property showProgressBar

                                          showProgressBar: boolean;

                                            property theClass

                                            theClass: string;

                                              property timeOut

                                              timeOut: number;

                                                property title

                                                title: any;

                                                  property titleIsTemplate

                                                  titleIsTemplate: boolean;

                                                    method attachOverrides

                                                    attachOverrides: () => void;

                                                      method ngOnDestroy

                                                      ngOnDestroy: () => void;

                                                        method ngOnInit

                                                        ngOnInit: () => void;

                                                          method onClick

                                                          onClick: (event: MouseEvent) => void;

                                                            method onClickIcon

                                                            onClickIcon: (event: MouseEvent) => void;

                                                              method onEnter

                                                              onEnter: () => void;

                                                                method onLeave

                                                                onLeave: () => void;

                                                                  method startTimeOut

                                                                  startTimeOut: () => void;

                                                                    class NotificationsService

                                                                    class NotificationsService {}

                                                                      constructor

                                                                      constructor(globalOptions: any);

                                                                        property emitter

                                                                        emitter: Subject<NotificationEvent>;

                                                                          property globalOptions

                                                                          globalOptions: any;

                                                                            property icons

                                                                            icons: Icons;

                                                                              property ɵfac

                                                                              static ɵfac: i0.ɵɵFactoryDeclaration<NotificationsService, never>;

                                                                                property ɵprov

                                                                                static ɵprov: i0.ɵɵInjectableDeclaration<NotificationsService>;

                                                                                  method alert

                                                                                  alert: (
                                                                                  title?: any,
                                                                                  content?: any,
                                                                                  override?: any,
                                                                                  context?: any
                                                                                  ) => Notification;

                                                                                    method bare

                                                                                    bare: (
                                                                                    title?: any,
                                                                                    content?: any,
                                                                                    override?: any,
                                                                                    context?: any
                                                                                    ) => Notification;

                                                                                      method create

                                                                                      create: (
                                                                                      title?: any,
                                                                                      content?: any,
                                                                                      type?: NotificationType,
                                                                                      override?: any,
                                                                                      context?: any
                                                                                      ) => Notification;

                                                                                        method error

                                                                                        error: (
                                                                                        title?: any,
                                                                                        content?: any,
                                                                                        override?: any,
                                                                                        context?: any
                                                                                        ) => Notification;

                                                                                          method html

                                                                                          html: (
                                                                                          html: any,
                                                                                          type?: NotificationType,
                                                                                          override?: any,
                                                                                          icon?: string,
                                                                                          context?: any
                                                                                          ) => Notification;

                                                                                            method info

                                                                                            info: (
                                                                                            title?: any,
                                                                                            content?: any,
                                                                                            override?: any,
                                                                                            context?: any
                                                                                            ) => Notification;

                                                                                              method remove

                                                                                              remove: (id?: string) => void;

                                                                                                method set

                                                                                                set: (notification: Notification, to: boolean) => Notification;

                                                                                                  method success

                                                                                                  success: (
                                                                                                  title?: any,
                                                                                                  content?: any,
                                                                                                  override?: any,
                                                                                                  context?: any
                                                                                                  ) => Notification;

                                                                                                    method warn

                                                                                                    warn: (
                                                                                                    title?: any,
                                                                                                    content?: any,
                                                                                                    override?: any,
                                                                                                    context?: any
                                                                                                    ) => Notification;

                                                                                                      class SimpleNotificationsComponent

                                                                                                      class SimpleNotificationsComponent implements OnInit, OnDestroy {}

                                                                                                        constructor

                                                                                                        constructor(service: NotificationsService, cd: ChangeDetectorRef);

                                                                                                          property animate

                                                                                                          animate: NotificationAnimationType;

                                                                                                            property clickIconToClose

                                                                                                            clickIconToClose: boolean;

                                                                                                              property clickToClose

                                                                                                              clickToClose: boolean;

                                                                                                                property create

                                                                                                                create: EventEmitter<any>;

                                                                                                                  property destroy

                                                                                                                  destroy: EventEmitter<any>;

                                                                                                                    property maxLength

                                                                                                                    maxLength: number;

                                                                                                                      property notifications

                                                                                                                      notifications: Notification[];

                                                                                                                        property ɵcmp

                                                                                                                        static ɵcmp: i0.ɵɵComponentDeclaration<
                                                                                                                        SimpleNotificationsComponent,
                                                                                                                        'simple-notifications',
                                                                                                                        never,
                                                                                                                        { options: 'options' },
                                                                                                                        { create: 'create'; destroy: 'destroy' },
                                                                                                                        never,
                                                                                                                        never
                                                                                                                        >;

                                                                                                                          property ɵfac

                                                                                                                          static ɵfac: i0.ɵɵFactoryDeclaration<SimpleNotificationsComponent, never>;

                                                                                                                            property pauseOnHover

                                                                                                                            pauseOnHover: boolean;

                                                                                                                              property position

                                                                                                                              position: Position;

                                                                                                                                property rtl

                                                                                                                                rtl: boolean;

                                                                                                                                  property showProgressBar

                                                                                                                                  showProgressBar: boolean;

                                                                                                                                    property theClass

                                                                                                                                    theClass: string;

                                                                                                                                      property timeOut

                                                                                                                                      timeOut: number;

                                                                                                                                        method add

                                                                                                                                        add: (item: Notification) => void;

                                                                                                                                          method attachChanges

                                                                                                                                          attachChanges: (options: any) => void;

                                                                                                                                            method block

                                                                                                                                            block: (item: Notification) => boolean;

                                                                                                                                              method buildEmit

                                                                                                                                              buildEmit: (notification: Notification, to: boolean) => Notification;

                                                                                                                                                method checkHtml

                                                                                                                                                checkHtml: (checker: Notification, item: Notification) => boolean;

                                                                                                                                                  method checkStandard

                                                                                                                                                  checkStandard: (checker: Notification, item: Notification) => boolean;

                                                                                                                                                    method cleanSingle

                                                                                                                                                    cleanSingle: (id: string) => void;

                                                                                                                                                      method defaultBehavior

                                                                                                                                                      defaultBehavior: (value: any) => void;

                                                                                                                                                        method ngOnDestroy

                                                                                                                                                        ngOnDestroy: () => void;

                                                                                                                                                          method ngOnInit

                                                                                                                                                          ngOnInit: () => void;

                                                                                                                                                            class SimpleNotificationsModule

                                                                                                                                                            class SimpleNotificationsModule {}

                                                                                                                                                              property ɵfac

                                                                                                                                                              static ɵfac: i0.ɵɵFactoryDeclaration<SimpleNotificationsModule, never>;

                                                                                                                                                                property ɵinj

                                                                                                                                                                static ɵinj: i0.ɵɵInjectorDeclaration<SimpleNotificationsModule>;

                                                                                                                                                                  property ɵmod

                                                                                                                                                                  static ɵmod: i0.ɵɵNgModuleDeclaration<
                                                                                                                                                                  SimpleNotificationsModule,
                                                                                                                                                                  [typeof i1.SimpleNotificationsComponent, typeof i2.NotificationComponent],
                                                                                                                                                                  [any, any],
                                                                                                                                                                  [typeof i1.SimpleNotificationsComponent]
                                                                                                                                                                  >;

                                                                                                                                                                    method forRoot

                                                                                                                                                                    static forRoot: (
                                                                                                                                                                    options?: Options
                                                                                                                                                                    ) => ModuleWithProviders<SimpleNotificationsModule>;

                                                                                                                                                                      Interfaces

                                                                                                                                                                      interface Icons

                                                                                                                                                                      interface Icons {}

                                                                                                                                                                        property alert

                                                                                                                                                                        alert: string;

                                                                                                                                                                          property error

                                                                                                                                                                          error: string;

                                                                                                                                                                            property info

                                                                                                                                                                            info: string;

                                                                                                                                                                              property success

                                                                                                                                                                              success: string;

                                                                                                                                                                                property warn

                                                                                                                                                                                warn: string;

                                                                                                                                                                                  interface Notification

                                                                                                                                                                                  interface Notification {}

                                                                                                                                                                                    property animate

                                                                                                                                                                                    animate?: NotificationAnimationType;

                                                                                                                                                                                      property click

                                                                                                                                                                                      click?: EventEmitter<{}>;

                                                                                                                                                                                        property clickIcon

                                                                                                                                                                                        clickIcon?: EventEmitter<{}>;

                                                                                                                                                                                          property clickIconToClose

                                                                                                                                                                                          clickIconToClose?: boolean;

                                                                                                                                                                                            property clickToClose

                                                                                                                                                                                            clickToClose?: boolean;

                                                                                                                                                                                              property content

                                                                                                                                                                                              content?: any;

                                                                                                                                                                                                property context

                                                                                                                                                                                                context?: any;

                                                                                                                                                                                                  property createdOn

                                                                                                                                                                                                  createdOn?: Date;

                                                                                                                                                                                                    property destroyedOn

                                                                                                                                                                                                    destroyedOn?: Date;

                                                                                                                                                                                                      property html

                                                                                                                                                                                                      html?: any;

                                                                                                                                                                                                        property icon

                                                                                                                                                                                                        icon: string;

                                                                                                                                                                                                          property id

                                                                                                                                                                                                          id?: string;

                                                                                                                                                                                                            property maxLength

                                                                                                                                                                                                            maxLength?: number;

                                                                                                                                                                                                              property override

                                                                                                                                                                                                              override?: any;

                                                                                                                                                                                                                property pauseOnHover

                                                                                                                                                                                                                pauseOnHover?: boolean;

                                                                                                                                                                                                                  property state

                                                                                                                                                                                                                  state?: string;

                                                                                                                                                                                                                    property theClass

                                                                                                                                                                                                                    theClass?: string;

                                                                                                                                                                                                                      property timeOut

                                                                                                                                                                                                                      timeOut?: number;

                                                                                                                                                                                                                        property timeoutEnd

                                                                                                                                                                                                                        timeoutEnd?: EventEmitter<{}>;

                                                                                                                                                                                                                          property title

                                                                                                                                                                                                                          title?: any;

                                                                                                                                                                                                                            property type

                                                                                                                                                                                                                            type: NotificationType;

                                                                                                                                                                                                                              interface NotificationEvent

                                                                                                                                                                                                                              interface NotificationEvent {}

                                                                                                                                                                                                                                property add

                                                                                                                                                                                                                                add?: boolean;

                                                                                                                                                                                                                                  property command

                                                                                                                                                                                                                                  command: string;

                                                                                                                                                                                                                                    property id

                                                                                                                                                                                                                                    id?: string;

                                                                                                                                                                                                                                      property notification

                                                                                                                                                                                                                                      notification?: Notification;

                                                                                                                                                                                                                                        interface Options

                                                                                                                                                                                                                                        interface Options {}

                                                                                                                                                                                                                                          property animate

                                                                                                                                                                                                                                          animate?: NotificationAnimationType;

                                                                                                                                                                                                                                            property clickIconToClose

                                                                                                                                                                                                                                            clickIconToClose?: boolean;

                                                                                                                                                                                                                                              property clickToClose

                                                                                                                                                                                                                                              clickToClose?: boolean;

                                                                                                                                                                                                                                                property icons

                                                                                                                                                                                                                                                icons?: Icons;

                                                                                                                                                                                                                                                  property lastOnBottom

                                                                                                                                                                                                                                                  lastOnBottom?: boolean;

                                                                                                                                                                                                                                                    property maxLength

                                                                                                                                                                                                                                                    maxLength?: number;

                                                                                                                                                                                                                                                      property maxStack

                                                                                                                                                                                                                                                      maxStack?: number;

                                                                                                                                                                                                                                                        property pauseOnHover

                                                                                                                                                                                                                                                        pauseOnHover?: boolean;

                                                                                                                                                                                                                                                          property position

                                                                                                                                                                                                                                                          position?: Position;

                                                                                                                                                                                                                                                            property preventDuplicates

                                                                                                                                                                                                                                                            preventDuplicates?: boolean;

                                                                                                                                                                                                                                                              property preventLastDuplicates

                                                                                                                                                                                                                                                              preventLastDuplicates?: boolean | string;

                                                                                                                                                                                                                                                                property rtl

                                                                                                                                                                                                                                                                rtl?: boolean;

                                                                                                                                                                                                                                                                  property showProgressBar

                                                                                                                                                                                                                                                                  showProgressBar?: boolean;

                                                                                                                                                                                                                                                                    property theClass

                                                                                                                                                                                                                                                                    theClass?: string;

                                                                                                                                                                                                                                                                      property timeOut

                                                                                                                                                                                                                                                                      timeOut?: number;

                                                                                                                                                                                                                                                                        interface Position

                                                                                                                                                                                                                                                                        interface Position extends Array<VerticalPosition | HorizontalPosition> {}

                                                                                                                                                                                                                                                                          property 0

                                                                                                                                                                                                                                                                          0: VerticalPosition;

                                                                                                                                                                                                                                                                            property 1

                                                                                                                                                                                                                                                                            1: HorizontalPosition;

                                                                                                                                                                                                                                                                              Enums

                                                                                                                                                                                                                                                                              enum NotificationAnimationType

                                                                                                                                                                                                                                                                              enum NotificationAnimationType {
                                                                                                                                                                                                                                                                              Fade = 'fade',
                                                                                                                                                                                                                                                                              FromTop = 'fromTop',
                                                                                                                                                                                                                                                                              FromRight = 'fromRight',
                                                                                                                                                                                                                                                                              FromBottom = 'fromBottom',
                                                                                                                                                                                                                                                                              FromLeft = 'fromLeft',
                                                                                                                                                                                                                                                                              Scale = 'scale',
                                                                                                                                                                                                                                                                              Rotate = 'rotate',
                                                                                                                                                                                                                                                                              }

                                                                                                                                                                                                                                                                                member Fade

                                                                                                                                                                                                                                                                                Fade = 'fade'

                                                                                                                                                                                                                                                                                  member FromBottom

                                                                                                                                                                                                                                                                                  FromBottom = 'fromBottom'

                                                                                                                                                                                                                                                                                    member FromLeft

                                                                                                                                                                                                                                                                                    FromLeft = 'fromLeft'

                                                                                                                                                                                                                                                                                      member FromRight

                                                                                                                                                                                                                                                                                      FromRight = 'fromRight'

                                                                                                                                                                                                                                                                                        member FromTop

                                                                                                                                                                                                                                                                                        FromTop = 'fromTop'

                                                                                                                                                                                                                                                                                          member Rotate

                                                                                                                                                                                                                                                                                          Rotate = 'rotate'

                                                                                                                                                                                                                                                                                            member Scale

                                                                                                                                                                                                                                                                                            Scale = 'scale'

                                                                                                                                                                                                                                                                                              enum NotificationType

                                                                                                                                                                                                                                                                                              enum NotificationType {
                                                                                                                                                                                                                                                                                              Success = 'success',
                                                                                                                                                                                                                                                                                              Error = 'error',
                                                                                                                                                                                                                                                                                              Alert = 'alert',
                                                                                                                                                                                                                                                                                              Info = 'info',
                                                                                                                                                                                                                                                                                              Warn = 'warn',
                                                                                                                                                                                                                                                                                              Bare = 'bare',
                                                                                                                                                                                                                                                                                              }

                                                                                                                                                                                                                                                                                                member Alert

                                                                                                                                                                                                                                                                                                Alert = 'alert'

                                                                                                                                                                                                                                                                                                  member Bare

                                                                                                                                                                                                                                                                                                  Bare = 'bare'

                                                                                                                                                                                                                                                                                                    member Error

                                                                                                                                                                                                                                                                                                    Error = 'error'

                                                                                                                                                                                                                                                                                                      member Info

                                                                                                                                                                                                                                                                                                      Info = 'info'

                                                                                                                                                                                                                                                                                                        member Success

                                                                                                                                                                                                                                                                                                        Success = 'success'

                                                                                                                                                                                                                                                                                                          member Warn

                                                                                                                                                                                                                                                                                                          Warn = 'warn'

                                                                                                                                                                                                                                                                                                            Type Aliases

                                                                                                                                                                                                                                                                                                            type HorizontalPosition

                                                                                                                                                                                                                                                                                                            type HorizontalPosition = 'right' | 'left' | 'center';

                                                                                                                                                                                                                                                                                                              type VerticalPosition

                                                                                                                                                                                                                                                                                                              type VerticalPosition = 'top' | 'bottom' | 'middle';

                                                                                                                                                                                                                                                                                                                Package Files (11)

                                                                                                                                                                                                                                                                                                                Dependencies (1)

                                                                                                                                                                                                                                                                                                                Dev Dependencies (0)

                                                                                                                                                                                                                                                                                                                No dev dependencies.

                                                                                                                                                                                                                                                                                                                Peer Dependencies (1)

                                                                                                                                                                                                                                                                                                                Badge

                                                                                                                                                                                                                                                                                                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/angular2-notifications.

                                                                                                                                                                                                                                                                                                                • Markdown
                                                                                                                                                                                                                                                                                                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/angular2-notifications)
                                                                                                                                                                                                                                                                                                                • HTML
                                                                                                                                                                                                                                                                                                                  <a href="https://www.jsdocs.io/package/angular2-notifications"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>