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

@vladimirmana/loader

v0.2.2

Published

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.0.1. # Install

Downloads

58

Readme

Loader

This library was generated with Angular CLI version 9.0.1.

Install

npm install @vladimirmana/loader

Usage

1. Import the VMLoader module in app.module.ts

import { VMLoaderModule } from '@vladimirmana/loader';
@NgModule({
    imports: [
        VMLoaderModule
    ],
    bootstrap: [AppComponent]
})
export class AppModule { }

2. Add the loader component in your page

<vm-loader [loaderSettings]="appLoader"></vm-loader>

3. Set loader settings

public appLoader: LoaderSettings = { name: 'mainLoader'};
Loader settings interface
export interface LoaderSettings {
  name: string, // The name of the loader is unique. Loader named 'httpLoader' is opened and closed with http events but can be handled manually as well 
  spinnerType?: string,
  relativeLoader?:boolean, // The loader is with position fixed by default. Through this property you can use the loader as relative element
  absoluteLoader?: boolean, // You can add the loader in relative container and use it as absolute element
  logoUrl?: string,
  backgroundUrl?: string,
  cssProperties?: CssProperties,
  openLoaderConditions?: Array<OpenLoaderCondition> // Additional requried conditions that should be meet in order to open the loader
}
If you use http loader, you can restrict on which routes you want to show it or not. That can be achieved with setting up restricted http routes in the configuration of the loader module
The Loader Configuration can be injected through the forRoot method
@NgModule({
    imports: [
        VMLoaderModule.forRoot({
          restrictedHttpRoutes:[]
        })
    ],
})
Loader configuration
export interface RestrictedRoute {
  url: string
  method: string
}
export class LoaderConfig {
  restrictedHttpRoutes?: Array<RestrictedRoute> //Handled only for httpLoader
}

Insert additional conditions in which you want to open the loader

When you are using multiple loaders on one page you might want to have set of rules or conditions in which you want to show some loaders depending on the state of the others. Add list of addional conditions in order to avoid conflicts between the loaders.
Open Loader Conditions Interface
export interface OpenLoaderCondition {
  loaderName: string, // Name of the loader that is connected with the condition
  visible: boolean // State of that loader that is requred for the condition
}

Customize the loader through the available css properties

Css Properties interface
export interface CssProperties {
  background_color?: string
  opacity?: number,
  spinner_color?: string
}
Import loaderService to component.ts
import { VMLoaderService } from '@vladimirmana/loader';
export class [componentName]{
  constructor(
    private loaderServce: VMLoaderService) {
  }
Open specific loader
this.loaderService.openLoader([loaderName])
Close specific loader
this.loaderService.closeLoader([loaderName])

Available spinners