When passing an Observable array to modal dialog params, I encountered an issue where opening the dialog displayed [object Object] when using RadListView. However, everything worked fine with ListView except for RadListView.
HomeComponent.ts:
public obsArr: ObservableArray<App>;
ngOnInit(){
this.obsArr= this.homeService.getMyApps();
}
const options = {
context: this.obsArr,
fullscreen: true,
viewContainerRef: this.vcRef
};
this.modal.showModal(FirstComponent, options).then((resource) => {
});
FirstComponent.ts: (Modal dialog)
public firstAppArr: ObservableArray<App>;
constructor(private params: ModalDialogParams, private routerExtensions: RouterExtensions) {
}
ngOnInit() {
this.firstAppArr= this.params.context;
}
first_component.html: (Modal dialog html)
<RadListView [items]="firstAppArr" itemReorder="true">
<ng-template let-item="item" let-i="index">
<GridLayout rows="auto" columns="*,*">
<StackLayout col="0" horizontalAlignment="left" verticalAlignment="center">
<Label [text]="item.name" textWrap="true"></Label>
</StackLayout>
<StackLayout col="1" horizontalAlignment="right" verticalAlignment="center">
<Label [text]="item.description" textWrap="true"></Label>
</StackLayout>
</GridLayout>
</ng-template>
</RadListView>