npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng-angular-popup

v0.6.2

Published

Angular 12+ popup notification library for web applications.

Downloads

5,054

Readme

ng-angular-popup

This library was generated with Angular CLI version 18.0.1.

Code Implementation : Let's Program Blog

Changelog

  • Removed the object way of configuration
  • Removed dependency of font-awesome
  • Updated the library with Angular v18
  • Signal usage for better compatibility with zoneless

Features

  • Easy to integrate
  • Supports success, error, info and warning toaster messages
  • Easy to configure
  • supports title, message , position, duration
  • New UI design with better accessibility

Dependencies

Recommend to use the latest version of ng-angular-popup More Compatible with Latest version of Angular

| ng-angular-popup | Angular | | ---------------- | ----------- | | current | >= 16.x | | 0.5.2 | <= 15.x |

For Lower version of Angular use

npm i ng-angular-popup -f

Install

npm i ng-angular-popup

Setup

  • Add NgToasterModule to App NgModule

  • import NgToastModule in app.module.ts

import { NgModule } from '@angular/core';
import { HeaderComponent } from './component/header/header.component';
import { NgToastModule } from 'ng-angular-popup' // to be added

@NgModule({
  declarations: [
    HeaderComponent,

  ],
  imports: [
    NgToastModule // to be added
  ],

})
export class AppModule { }
  • Add NgToasterModule to Standalone root component

  • import NgToastModule in app.component.ts

import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { NgToastModule } from 'ng-angular-popup' // to be added
import { ToasterPosition } from 'ng-toasty'; // to be added to load position enums

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [RouterOutlet, NgToastModule],
  templateUrl: './app.component.html',
  styleUrl: './app.component.scss'
})
export class AppComponent {
  title = 'angular-v18-playground';
  ToasterPosition = ToasterPosition;
}
  • use the selector in app.component.html file
<ng-toast />  <!-- takes default width of 350px and top-right position   -->
<ng-toast [width]="400" /> <!-- configure width   -->
<ng-toast [width]="300" [position]="ToasterPosition.TOP_CENTER" /> <!-- configure width with position   -->

Use

import { Component } from '@angular/core';
import { NgToastService } from 'ng-angular-popup'; //make sure to import service

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {

  private = inject(NgToastService); //inject the service

  ngOnInit(): void {
  }

  error(){
    this.toast.danger("This is new error message"); // by default visible duration is 2000ms
  }

  success(){
    this.toast.success("This is new error Success", "SUCCESS", 5000) // message with title and 5000ms duration
  }

  info(){
    this.toast.info("This is new error Info", "INFO", 5000)
  }

  warning(){
    this.toast.warning("This is new Warning message", "WARNING", 5000)
  }

}

FAQ

Check out article on ng-angular-popup Integration with Angular

License

MIT


GitHub @SashikumarYadav  ·  Blog @LetsProgram  ·  LinkedIn @SashikumarYadav  ·  Medium @SashikumarYadav