I am attempting to design a div that initially displays the text loading...
, and then can be covered by new elements as they are loaded into it. Below is the code snippet I am working with:
<div class="results" style="position:relative;" *ngIf="showResults">
<!-- Show 'loading...' before the results load, which will then overlap this text -->
<div stlye="position: absolute; z-index: -1;">Loading ...</div>
<!-- Angular2 loop to asynchronously load results -->
<div *ngFor="let loc of searchLocations | async" (click)="selectLocation(loc)" class="search-result">
{{ loc.name }}, {{ loc.adminName1 }}, {{ loc.countryCode }}
</div>
</div>
However, when I execute this code, the result is similar to what is shown in the following image:
https://i.sstatic.net/5U2J0.png
The issue is that my 'loading...' text has its own boundary, instead of allowing the subsequent elements to overlap it. How can I achieve the desired effect?