@nikiphoros/ngx-confirm
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

Getting Started

Ngx-Confirm - alerts, confirms and dialogs in one.

The quickest way to build modals with angular ngx-confirm manages the scope, you don't need to worry about anything, so that you can throw in a template and render stuff right away.

Authors

Installation

Install @nikiphoros/ngx-confirm with npm command

  npm install @nikiphoros/ngx-confirm

Add needed package to NgModule imports:

import { NgxConfirmModule } from '@nikiphoros/ngx-confirm';

@NgModule({
  ...
  imports: [NgxConfirmModule,...]
  ...
})

Usage

After importing NgxConfirmModule module in your app, use a component in your html:

<button (click)="openAlert()" class="btn">Open Alert Box</button>

And in component.ts file

import { Component } from '@angular/core';
import { NgxConfirmUiService } from '@nikiphoros/ngx-confirm/src/lib/ngx-confirm.service';
import { transition,types } from '@nikiphoros/ngx-confirm/src/lib/components/alert/alert';

export class AppComponent() {
  constructor(private NgxConfirm: NgxConfirmUiService) {}
 
 openAlert() {
    this.NgxConfirm.open({
      title: 'Alert Box',
      type: types.primary,
      text: 'Text here',
      backDrop: true,
      largeWidth: true,
      transition: transition.na,
      buttons: [
        { text: 'OK', btnClass:"xyz" }, 
        { text: 'Submit'}
      ],
    }).subscribe((suc) => {
      console.log(suc);
    });
  }
}

Documentation

https://nikiphoros.github.io/lib/

Readme

Keywords

none

Package Sidebar

Install

npm i @nikiphoros/ngx-confirm

Weekly Downloads

0

Version

0.0.4

License

none

Unpacked Size

93.7 kB

Total Files

22

Last publish

Collaborators

  • nikiphoros