Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Most often, this is done by a service of the AppLockService type that sends messages of the APP_LOCK / UNLOCK type, which in turn catches a component of the AppLockComponent type and, based on the data from the message, hides or shows an overlay with a twist; it is enough to call, for example, the _appLockService.lock_ method and the twist will appear. It can be convenient to execute this method as an asynchronous function, then you can automatically send messages - before the lock and after exiting the asynchronous procedure, very convenient. There are tons of naturally ready-made solutions on the Internet
I usually do this:
component.ts
loading: boolean = false;
data = [];
ngOnInit() {
this.loading = true;
this.service.getAll().subscribe(res => {
this.data = res;
this.loading = false;
});
}
<ng-container *ngIf="loading">
<div class="loader"> </div>
</ng-container>
<ng-container *ngIf="!loading">
//показываем данные
</ng-container>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question