Skip to content

Instantly share code, notes, and snippets.

@GrillPhil
Last active June 27, 2018 07:54
Show Gist options
  • Save GrillPhil/dba4963a08d3b4df1eb5b06f039a3437 to your computer and use it in GitHub Desktop.
Save GrillPhil/dba4963a08d3b4df1eb5b06f039a3437 to your computer and use it in GitHub Desktop.
<div class="blocking-loading-overlay" *ngIf="isLoading">
<div>
<app-spinner [fill]="'#aaa'" [margin]="'20px auto'"></app-spinner>
<p>{{loadingMessage}}</p>
</div>
</div>
.blocking-loading-overlay {
background: rgba(0, 0, 0, 0.6);
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
}
.blocking-loading-overlay > div {
background: white;
padding: 32px;
text-align: center;
}
import { Component, OnInit } from '@angular/core';
import { BlockingProgressService } from './blocking-progress.service';
@Component({
selector: 'blocking-progress',
templateUrl: './blocking-progress.component.html',
styleUrls: [ './blocking-progress.component.scss']
})
export class BlockingProgressComponent implements OnInit {
isLoading: boolean = false;
loadingMessage: string;
constructor(private _blockingProgressService: BlockingProgressService) {}
ngOnInit() {
this._blockingProgressService.isLoading.subscribe(value => {
this.isLoading = value;
});
this._blockingProgressService.loadingMessage.subscribe(value => {
this.loadingMessage = value;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment