Angular2-Busy
Angular 2 Busy can show busy/loading indicators on any promise, or on any Observable's subscription.
Rewritten from angular-busy, and add some new features in terms of Angular 2.
Built with Angular 4.0.1
Demo
devyumao.github.io/angular2-busy/demo/asset/
Installation
Link CSS
Getting Started
Import the BusyModule in your root application module:
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {BusyModule} from 'angular2-busy';
@NgModule({
imports: [
// ...
BrowserAnimationsModule,
BusyModule
],
// ...
})
export class AppModule {}
Reference your promise in the ngBusy directive:
import {Http} from '@angular/http';
@Component({
selector: 'some',
template: `
`
})
class SomeComponent implements OnInit {
busy: Promise<any>;
constructor(private http: Http) {}
ngOnInit() {
this.busy = this.http.get('...').toPromise();
}
}