Skip to content

jgluhov/ng2-spinning-preloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ng2-spinning-preloader

Animate Angular2 compilation process by using ng2-spinning-preloader service.

Table of Contents

Installation

npm install --save ng2-spinning-preloader

Quick Start

Import the NgSpinningPreloader class and add it to your application module as an import. Once you've done this, you'll be able to inject `NgSpinningPreloader' into your Angular2 Components.

import {NgSpinningPreloader} from 'ng2-spinning-preloader';

@NgModule({
  /* ... */
  providers: [ NgSpinningPreloader ]
})

export class AppModule {}

Insert in your index.html spinning-preloader element

<body>
	<div class="spinning-preloader-container">
		<div class="spinning-preloader-elements"></div>
	</div>
	<app></app>
</body>

Import styles of ng-2spinning-preloader

  require('ng2-spinning-preloader/dist/ng-spinning-preloader.css');

Example

import {
  Component,
  OnInit
} from '@angular/core';
import {NgSpinningPreloader} from 'ng2-spinning-preloader';

@Component({
  selector: 'app',
  template: 'App component'
})

export class AppComponent implements OnInit {
  constructor(private ngSpinningPreloader: NgSpinningPreloader) {}

  ngOnInit() {
    this.ngSpinningPreloader.stop();
  }
}

About

A spinner preloader widget for Angular2

Resources

Stars

Watchers

Forks

Packages

No packages published