Skip to content

Latest commit

 

History

History
67 lines (51 loc) · 1.34 KB

README.md

File metadata and controls

67 lines (51 loc) · 1.34 KB

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();
  }
}