standard-angular-popup
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

Angular Standard Popup

This is a simple Popup implentation for Angular 8. You can add any data in this popup as it accepts data in the section

Configuration

Imports to be done in app module

import { AngularPopupComponent,CustomButtonComponent } from 'standard-angular-popup'

The popup can be called on a page by adding the following code after neccessry imports in the Appmodule

<app-popup [data]="showModal" (close)="onClose()" (confirm)="onConfirm()"></app-popup>

Inputs

The List of Fields in the data object are as follows

id: string; ( Unique Id for the popup)
title: string; 
visible: boolean; ( Popup would show hide based on this )
confirmText: string; ( Text on confirm button)
closeText: string; ()
confirmClass: string;
closeClass: string;
titleClass: string;

Sample Config

showModal = {
  id: "requestinformation",
  title: "REQUEST INFORMATION",
  closeText: "Cancel",
  confirmText: "Submit Request for Information",
  visible: false,
  confirmClass: 'custom-primary',
  closeClass: 'custom-secondary',
  titleClass: 'title'
};

To show popup

this.showModal.visible = true; 

Methods

The popup exposes two methods close and confirm. You can hide the popup in these methods by setting the object visible value to false

  onClose() {
    this.showModal.visible= false;
  }

  onConfirm() {
    this.showModal.visible= false;
  }

Working Example

Demo

Readme

Keywords

Package Sidebar

Install

npm i standard-angular-popup

Weekly Downloads

7

Version

0.0.6

License

none

Unpacked Size

108 kB

Total Files

29

Last publish

Collaborators

  • bkhanna