Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
ng-angular-popup
Advanced tools
This library was generated with Angular CLI version 18.0.1.
Code Implementation : Let's Program Blog
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
npm i ng-angular-popup
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;
}
<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 -->
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)
}
}
Check out article on ng-angular-popup Integration with Angular
MIT
GitHub @SashikumarYadav · Blog @LetsProgram · LinkedIn @SashikumarYadav · Medium @SashikumarYadav
FAQs
Angular 12+ popup notification library for web applications.
We found that ng-angular-popup demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.