import { LoadingService, ngkLoadingAnimationTypes } from 'ngk-loading';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent implements OnInit {
title = 'ngk-loading';
@ViewChild('loadingContainer') loadingContainer: ElementRef;
@ViewChild('templatecustome') templatecustome: ElementRef;
ngkLoadingAnimationTypes = ngkLoadingAnimationTypes;
constructor(private loadingService: LoadingService) {}
ngOnInit(): void {
this.loadingService.showContainer(this.loadingContainer, this.templatecustome, { fullScreenBackdrop: false, backDrop: true });
this.loadingService.showContainer(this.loadingContainer, '<p>Loading....</p>', { fullScreenBackdrop: false, backDrop: true });
this.loadingService.show();
}
hide() {
this.hide();
this.loadingService.hide(this.loadingContainer);
}
}