Skip to content

manthanank/ng-loader

Repository files navigation

NgLoader

This is a simple Angular loader library.

npm npm npm npm

Installation

npm install @manthanankolekar/ng-loader

Usage

Import

import { Component } from '@angular/core';

import { NgLoaderComponent } from '@manthanankolekar/ng-loader';

@Component({
  selector: 'app-root',
  imports: [
    NgLoaderComponent
  ],
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'ng-loader';
}

Use

<ng-loader [loading]="isLoading" [loaderMessage]="loaderMessage"></ng-loader>
import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})

export class AppComponent {
  isLoading = false;
  loaderMessage = 'Loading, please wait...';

  toggleLoader() {
    this.isLoading = true;
    // Optionally update the loader message here.
    setTimeout(() => {
      this.isLoading = false;
    }, 3000);
  }
}

Demo

Stackblitz

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

Ng Loader

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published