![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
ng-snotify
Advanced tools
https://artemsky.github.io/ng-snotify/
To install this library, run:
$ npm install ng-snotify -S
and then from your Angular AppModule
:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import your library
import { SnotifyModule, SnotifyService } from 'ng-snotify';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
// Import SnotifyModule, also you can try SnotifyModule.forRoot() if you have build errors
SnotifyModule
],
providers: [SnotifyService],
bootstrap: [AppComponent]
})
export class AppModule { }
Add app-snotify
component to you root component
<!-- You can now use your library component in app.component.html -->
<app-snotify></app-snotify>
Now you should inject SnotifyService
import {Component, OnInit} from '@angular/core';
// Import SnotifyService
import {SnotifyService} from 'ng-snotify';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
// Inject SnotifyService
constructor(private snotifyService: SnotifyService) {}
//You can set global config like this
ngOnInit() {
this.snotifyService.setConfig({
timeout: 30000
}, {
newOnTop: false,
});
}
//Hopefuly you can add a toast
addToast() {
this.snotifyService.success('Example success!', 'Here we are');
this.snotifyService.error('Example error!', 'Here we are', {
closeOnClick: false
});
this.snotifyService.warning('Example warning!', 'Here we are');
this.snotifyService.info('Example info!', 'Here we are');
this.snotifyService.bare('Example bare!', 'Here we are');
}
//You can remove all toasts from the field
clearToasts() {
this.snotifyService.clear();
}
}
Once your library is imported, you can use its components, interfaces and service in your Angular application:
To generate all *.js
, *.d.ts
and *.metadata.json
files:
$ npm run build
To lint all *.ts
files:
$ npm run lint
MIT © artemsky
FAQs
Angular 2+ notifications center
The npm package ng-snotify receives a total of 2,644 weekly downloads. As such, ng-snotify popularity was classified as popular.
We found that ng-snotify demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.