https://oxycoder.github.io/ng2-loading-animate/demo/
Loading animation for angular 2
Install through npm:
npm install --save ng2-loading-animate
Then use it in your app like so:
app.module.ts
import { LoadingAnimateModule, LoadingAnimateService } from 'ng2-loading-animate';
@NgModule({
imports: [
...
LoadingAnimateModule.forRoot()
...
],
providers: [
...
LoadingAnimateService
...
]
})
Add directives to your app.component.html (usually at top):
<loading-animate></loading-animate>
In component, to start loading animate: test.component.ts
import { LoadingAnimateService } from 'ng2-loading-animate';
constructor(private _loadingSvc: LoadingAnimateService)
start() {
this._loadingSvc.setValue(true);
}
stop() {
this._loadingSvc.setValue(false);
}
npm install
while current directory is this repoRun npm start
to start a development server on port 8000 with auto reload + tests.
Run npm test
to run tests once or npm run test:watch
to continually run tests.
MIT
Generated using TypeDoc