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

ng7-snack-bar

v1.7.9

Published

SnackBar is a service for displaying snack-bar notifications. On latest version of angular 7

Downloads

248

Readme

Snackbar For ANGULAR 4/5/6/7

SnackBar is a service for displaying snack-bar notifications. On latest version of angular 4/5/6/7.

  • Group snackbar based on Type, Content.
  • Rank snackbar.

Versions

| ng7-snack-bar | Angular | | ------------ | ------- | | 1.6.0 | 4.x | | 1.7.0 | 5.x | | 1.7.0 | 6.x | | 1.7.0 | 7.x |

Get Started

  • Please create issues or add suggestions, I am actively working on this module.
  • Setup Code https://stackblitz.com/edit/ng7-snack-bar

  • Demo https://ng7-snack-bar.stackblitz.io

  • Install
    npm install ng7-snack-bar --save
    npm install @ngrx/store --save
    npm install @angular/animations --save (Only for angular >=5.X )
  • Import the SnackBarModule
    import { SnackBarModule } from 'ng7-snack-bar';
    import { StoreModule } from '@ngrx/store';
    
    @NgModule({
      declarations: [AppComponent, ...],
      imports: [SnackBarModule.forRoot(), StoreModule.forRoot([]), ...],
      bootstrap: [AppComponent]
    })
    export class AppModule {
    }
  • Add the SnackBarContainer to AppComponent
 <sb-container></sb-container>
  • Import the SnackBarService to Needed Component
import { SnackBarService } from 'ng7-snack-bar';

constructor(
   private snackBarService: SnackBarService
) {}

showNotification(): void {
 // Info
 this.snackBarService.info('title', 'content', 'detail',);
 // Success
 this.snackBarService.success('title', 'content', 'detail');
 // Warn
 this.snackBarService.warn('title', 'content', 'detail');
 // Error
 this.snackBarService.error('title', 'content', 'detail');
}

Features

| OPTION | TYPE | DEFAULT | DESCRIPTION | |------------------------|-------------------|---------------------------------|-------------------------------------------| | position | PositionType | BOTTOM_RIGHT | 4 Positions, to show the snack-bar | | maxNoOfSnackBar | number | 10 | Displays max no of snackbar | | autoCloseOnTransition | boolean | false | Auto closes when page route occurs | | template | TemplateType | CLASSIC | Classic/Dark templates | | groupRuleType | GroupRuleType | NO_RULE | Groups the snack-bar based on type/content| | rankBars | Array | [] | Based on rank the snackbar displays | | infoOptions | IBarOptions | | Configure Info snackbar | | successOptions | IBarOptions | | Configure Success snackbar | | warnOptions | IBarOptions | | Configure Warn snackbar | | errorOptions | IBarOptions | | Configure Error snackbar |

Additional Snackbar Configuration

| OPTION | TYPE | DEFAULT | DESCRIPTION | |------------------------|-------------------|---------------------------------|-------------------------------------------| | isClose | boolean | false | Shows/Hides the close button | | closeTimeOut | number | 0 | Autoclose after specified interval | | isDetail | boolean | false | Shows/Hides the detail button | | panelClass | string | | Overrides the specific snackbar class | | opacity | number | 1 | Specifies the opacity of snackbar |

Service Details

| SERVICE | ARGUMENTS | TYPE | DESCRIPTION | |-------------------------------|-------------------|--------------------|-------------------------------------------------| | info, warn, success, error | title | string | Snack bar title, default 'Info' | | | content | string | Snack bar content | | | detail | string | Snack bar detail | | | actions | ISnackBarAction[] | max-3 label, isAutoClose, callBack: () => {} | | | options | ISnackBarConfig | isBackDrop |

Live

  • Demo https://ng7-snack-bar.stackblitz.io

UpComing Feature 2.0.0

Will add shortly, stay tuned