Pages UI
v5.0.1 - Pages Angular
v5.0.1 - Pages Angular
  • Getting Started
  • Layouts
  • Routing
  • Styles
  • Layout Components
    • Header
    • Menu Items
    • Sidebar
    • Horizontal Menu
    • Secondary Sidebar
    • Quick View
    • Overlay Search
  • Directives
    • Parallax
    • Retina Image
  • Bootstrap Components
  • Forms
    • Checkbox and Radio
    • Form Group
    • Input Helpers
    • Switch Toggle
    • Select
    • Select FX
    • Typeahead
    • Date Picker
    • Time Picker
    • Quill Editor
    • File Uploader
  • UI Components
    • Progress Bar
    • List View
    • Cards
    • Social Cards
    • Collapse
    • Tabs
    • Tree View
    • Sliders
    • Notifications
  • Tables / Datatables
  • Maps
  • Session and other pages
  • Service
  • Dashboards
  • Widgets
  • Charts
  • Change log
Powered by GitBook
On this page
  • Importing
  • How to use
  • API
  1. UI Components

Notifications

Pages Notification service that can be invoked from any page or component

Importing

First import it to your app module or any submodule as you wish

import { MessageModule } from '../@pages/components/message/message.module';
import { MessageService } from '../@pages/components/message/message.service';
@NgModule({
  imports: [MessageModule,...],
  providers: [MessageService,...]
})
export class AppModule(){}

How to use

import { Component, OnInit } from '@angular/core';
import { MessageService } from '../../@pages/components/message/message.service';

@Component({
  selector: 'app-notificationspage',
  templateUrl: './notificationspage.component.html',
  styleUrls: ['./notificationspage.component.scss'],
})
export class mySamplePage implements OnInit {

  constructor(private _notification: MessageService) { 
  }

  ngAfterViewInit() {
      this._notification.create(
          "primary",
          "Hello World",
          {
          Position:"top",
          Style:"bar",
          Duration:0
          }
      );
  }

}

API

Global configuration (Config)

parameter

Types of

Defaults

Instructions

Duration

Number

0

Duration, does not disappear when set to 0

Position

String

top

also supports bottom | bottom-left | bottom-right | top-left | top-right

Style

String

bar

bar | circle | simple

MaxStack

Number

8

The maximum number of prompts that can be displayed

PauseOnHover

Boolean

true

Pause countdown when mouse is over

MessageService service

method

parameter

Instructions

create

(type: string, content: string, options?: Object)

Provide type attribute, can be passed in options such as 'success'

html

(html: string, options?: Object)

HTML content can be used to render content

remove

(id?: string)

Remove specific id message, remove all messages when id is empty

PreviousSlidersNextTables / Datatables

Last updated 6 years ago