Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng-snotify

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-snotify - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

2

package.json
{
"name": "ng-snotify",
"version": "0.1.3",
"version": "0.1.4",
"description": "Angular 4 notifications center",

@@ -5,0 +5,0 @@ "repository": {

@@ -100,2 +100,50 @@ [![Build Status](https://travis-ci.org/artemsky/ng-snotify.svg?branch=master)](https://travis-ci.org/artemsky/ng-snotify)

## Configuration
###### Global Cofig (affects all toasts)
`SnotifyService` has method `setConfig`, wich takes 2 parametrs
1 - Object typeof `SnotifyConfig` or `null`
```typescript
export interface SnotifyConfig {
timeout?: number; //default: 1500
showProgressBar?: boolean; //default: true
type?: SnotifyType; //depends on toast type [success, error, warning, bare, info]
closeOnClick?: boolean; //default: true
}
```
2 - Object typeof `SnotifyOptions` or `null`
```typescript
export interface SnotifyOptions {
maxOnScreen?: number; //default: 8
newOnTop?: boolean; //default: true
position?: [SnotifyPosition, SnotifyPosition]; //default: Bottom, Right
positionOffset?: {horizontal?: string, vertical?: string}; //default: 10px, 10px
}
```
###### Toast Cofig (affects current toast)
You can call toast by calling one of 5 methods
* `success(title: string, body: string, config?: SnotifyConfig)`
* `warning(title: string, body: string, config?: SnotifyConfig)`
* `info(title: string, body: string, config?: SnotifyConfig)`
* `error(title: string, body: string, config?: SnotifyConfig)`
* `bare(title: string, body: string, config?: SnotifyConfig)`
```typescript
snotifyService.success('Example success!', 'Here we are', {
timeout: 0, // disable timeout,
showProgressBar: true, // won't affect because of timeout, if timeout set to 0. Progress Bar cannot exist anymore
closeOnClick: false
// One important thing: it is not recommended to change the type in all methods except the bare
});
```
All interfaces can be imported from `ng-snotify`
The best place to set global config is `ngOnInit()`
Once your library is imported, you can use its components, interfaces and service in your Angular application:

@@ -119,2 +167,2 @@

MIT © [artemsky](mailto:mr.artemsky@gmail.com)
MIT © [artemsky](mailto:mr.artemsky@gmail.com)
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc