Socket
Socket
Sign inDemoInstall

ngx-whats-new

Package Overview
Dependencies
5
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ngx-whats-new

Ngx-whats-new is an angular module with a multi-modal component that is typically used to present new features of your application.


Version published
Weekly downloads
146
increased by6.57%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

NgxWhatsNew

Ngx-whats-new is an angular module with a multi-modal component that is typically used to present new features of your application.

ngx-whats-new screencast

    npm i ngx-whats-new

Usage example:

Codesandbox example

Import the module:

    import { NgModule } from '@angular/core';
    import { NgxWhatsNewModule } from 'ngx-whats-new';
    import { AppComponent } from './app.component';

    @NgModule({
    declarations: [AppComponent],
    imports: [NgxWhatsNewModule],
    bootstrap: [AppComponent],
    })
    export class AppModule {}

Use <ngx-whats-new> in your component:

app.component.html

    <button (click)="showDialog()">Open Dialog</button>
    <ngx-whats-new
        *ngIf="isDialogVisible"
        (closeModal)="closeDialog()"
        [items]="modals"
        [options]="options"
    >
    </ngx-whats-new>

app.component.ts

    /** initial state of the modal */
    isDialogVisible = true;
    /** global options */
    options = {
        disableClose: true,
        customStyle: {
        width: '500px',
        borderRadius: '10px',
        boxShadow: '0px 0px 10px 5px #999',
        },
    };
    /** definition of all modals to show */
    modals = [
        {
            imageHeight: 500,
            imageSrc: 'https://placeimg.com/500/500/arch',
            title: 'What is new in 5.0',
            text: 'Lorem ipsum dolor sit amet, consectetur adipiscing el aspect et just.',
            html: 'Hello <b>world!</b>',
            button: {
                text: 'Okay',
                textColor: '#fff',
                bgColor: '#333',
            },
        },
        {
            text: 'Lorem ipsum dolor sit amet, consectetur adipiscing el aspect et just. Spsum dolor sit amet, consectetur adipiscing el aspect et just',
            button: {
                text: 'Got it!',
                textColor: '#fff',
                bgColor: '#333',
            },
        },
  ];

Available Options:

General options:

    export interface Options {
        disableClose?: boolean;
        enableKeyboardNavigation?: boolean;
        clickableNavigationDots?: boolean;
        customStyle: {
            width?: string;
            boxShadow?: string;
            borderRadius?: string;
            borderSize?: string;
        }
    }

Options of a single modal window:

    export interface ModalWindow {
        imageSrc?: string;
        text: string;
        imageHeight?: string;
        imageBgColor?: string;
        button?: {
            text: string;
            textColor: string;
            bgColor: string;
            position: string;
        };
    }

Keywords

FAQs

Last updated on 23 Jan 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc