I think that the best approach is to delay access to data inside a rendered component so navigation (and animation) from RadSideDrawer can complete. Then when data is accessible, rendering of a component starts.
If you mix RxJS delay operator (assuming you get data using Observable) with ActivityIndicator - you can get quite good results.
Below is one of many possible solutions.
TS file:
import { Component, OnInit } from "@angular/core";
import { Observable } from "rxjs";
import { EventItem } from "../../../../models/event-item.model";
import { AppStateFacadeService } from "../../../../services/app-state-facade.service";
import { delay } from "rxjs/operators";
@Component({
selector: "Test",
moduleId: module.id,
templateUrl: "./test.component.html",
styleUrls: ["./test.component.css"]
})
export class TestComponent implements OnInit {
events$: Observable<Array<EventItem>>;
constructor(private appStateFacade: AppStateFacadeService) {}
ngOnInit(): void {
this.events$ = this.appStateFacade.getEvents().pipe(delay(400));
}
}
HTML file:
<StackLayout *ngIf="events$ | async as events; else nocontent">
<ListView class="list-group" [items]="events">
<ng-template let-event="item">
<EventItem [eventItem]="event"></EventItem>
</ng-template>
</ListView>
</StackLayout>
<ng-template #nocontent>
<ActivityIndicator row="1" #activityIndicator busy="true" width="100" height="100" class="activity-indicator">
</ActivityIndicator>
</ng-template>