vso-loader
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

VsoLoader

Very simple loader for Angular 4. Display it during http request or other time loading.

Exemple inside a component:

import { Component, Input, OnInit } from '@angular/core';

@Component({
  selector: 'app-loader',
  templateUrl: './loader.component.html',
  styleUrls: ['./loader.component.css']
})
export class LoaderComponent implements OnInit {
  public loading: boolean
  constructor() {}

  ngOnInit() {
    this.loading = true
    this.httpService.addItem(data).subscribe(
        data => {
            //Do what you want
            this.loading = false
        }, 
        err => {
            // Log errors if any
            console.log(err);
            this.loading = false
        });
}

Then put in your template

<vso-loader [loading]="loading" spinner="./../img/img.svg" loadingMsg="Chargement..."></vso-loader>

You can pass some config :

  • config : [config]= {spinnerWidth: '300px', spinnerHeight: 'auto'}

Don't hesitate to update it !

#vso

Package Sidebar

Install

npm i vso-loader

Weekly Downloads

1

Version

1.0.5

License

MIT

Last publish

Collaborators

  • valsouche