A fairly simple and customizable spinner for your angular 2/4 component.
TypeScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
.npmignore
.travis.yml
.yo-rc.json
README.md
index.ts
package.json
tsconfig.json
tslint.json

README.md

ng2-component-spinner

Installation

To install this library, run:

$ npm install ng2-component-spinner --save

Usage

$ npm install ng2-component-spinner

and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import library
import { SpinnerComponentModule } from 'ng2-component-spinner';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,    
    SpinnerComponentModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Once this library is imported, you can use it in your Angular application: For this component to work, that component has to be wrapped in a relative positioned div.

<div style="position:relative">
<h1>
  {{title}}
</h1>
<spinner-component [spinnerShow]="<booleanVariable>"></spinner-component>
</div>

Development

To generate all *.js, *.js.map and *.d.ts files:

$ npm run tsc

To lint all *.ts files:

$ npm run lint

License

MIT © Shubhangi Gupta