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

@netcreaties/ngx-smart-banner

v2.0.0-1

Published

Angular service for the imlementation of a smart banner to notify your users about your available app.

Downloads

8,674

Readme

NgxSmartBanner

Angular service for the imlementation of a smart banner to notify your users about your available app.

This package is inspired by smartbannerjs and smart-app-banner

Peer dependencies

Dependency | Description --- | --- @angular/cdk/platform | To determine if the user comes from an android or ios device

For Angular 12 (ivy enabled) and up > Use v2.* For Angular 11 > 9 Use v1.*

Usage

Add the package as a dependency to your project using:

npm install @netcreaties/ngx-smart-banner
yarn add @netcreaties/ngx-smart-banner

Add the module to your app.module imports:

import { NgxSmartBannerModule } from '@netcreaties/ngx-smart-banner';
...

@NgModule({
    imports: [NgxSmartBannerModule],
    ...
})

Import the service in your app.component and initialize with settings

import { NgxSmartBannerService } from '@netcreaties/ngx-smart-banner';


constructor(
    private readonly ngxSmartBannerService: NgxSmartBannerService,
    private readonly viewContainerRef: ViewContainerRef,
) {
    this.ngxSmartBannerService.initialize({
        viewContainerRef: this.viewContainerRef,
        daysHidden: 15,
        daysReminder: 90,
    });
}

Configuration options

The following configuration options are available Option | Default | Description --- | --- | --- viewContainerRef (Required) | NULL | View container ref the service uses to create the component in title | Smart application | Name of your application author | Smartbanner author | The company name, for example price | FREE | Price in string priceSuffix.ios | - On the App Store | Suffix that should be added after price priceSuffix.andorid | - In Google Play | Suffix that should be added after price icon.ios | | Icon url for IOS devices, can be relative or absolute icon.android | | Icon url for android devices, can be relative or absolute closeLabel | Close | Label for close button buttonLabel | VIEW | Label for the view button buttonUrl.ios | | Url to store location ex. https://ios/application-url buttonUrl.android | | Url to google play ex. https://android/application-url enabledPlatforms | ['Android', 'IOS'] | Platforms to be enabled daysHidden | NULL | Days to hide the smart banner after pressing exit button, null for indefinitely daysReminder | NULL | Days to hide the smart banner after pressing the view button, null for indefinitely rating.ios | 5 | Star rating on App store (0-5) rating.android | 5 | Star rating on play store (0-5) hideRating | false | Use this option to hide the rating

Service events

Event | Description --- | --- onOpen | Executes when smart banner is created onClose | Executes when smart banner is destroyed

TODO

  • Create demo
  • Add events?