My goal is to implement a loading message that displays when the page is loaded. I have created a loader component as a child component, and I am passing a value from the parent. However, for unknown reasons, the loader is not being displayed.
I have attempted the following code:
I set up a component for the loader with the following content:
loader.ts
@Input() showLoader: boolean = false;
loader.html
<div class="modal-backdrop in" [style.display]="showLoader ? 'block' : 'none'">
When trying to display this loader from the main component, I pass the value like so:
html
<app-loader [showLoader]="loaderOn"></app-loader>
ts
public loaderOn: boolean = false;
ngOnInit() {
this.loaderOn = true;
}