angularionic-frameworkionic3angular-reduxsupertab

Angular does not update View (redux, ionic ...)


I have a very simple Ionic page. This page shows a status of a Reduxstate.In this page, I have a button in which I get into another page and there I can change the state and return back. If I return back the view will not update. I've spent quite a long time researching why that does not work. Unfortunately, no success.

Component

export class AssetDetailTechnicPage {
    @select(['asset', 'asset'])
    asset$: Observable<Asset>;
}

Template

<ion-content *ngIf="asset$ | async as asset">
    <!--Leistung für Systemeinheit-->
    <ion-card *ngIf="asset.assetSubKind.assetKindId === 2 && (asset.totalMemory || asset.hardDiskCapacity || asset.hardDiskTyp || asset.opticalDriveType
    || asset.bios || asset.displaySize || asset.cpu || asset.gpu)">
        <ion-card-header>
            <ion-icon name="build"></ion-icon> {{'PERFORMANCE' | translate}}
        </ion-card-header>
        <ion-card-content>
            <ion-label color="primary" *ngIf="asset.totalMemory">
                {{'MAIN_MEMORY' | translate}}:
            </ion-label> {{asset.totalMemory}}
            <ion-label color="primary" *ngIf="asset.hardDiskCapacity">
                {{'HDD_CAPACITY' | translate}}:
            </ion-label> {{asset.hardDiskCapacity}}
            <ion-label color="primary" *ngIf="asset.hardDiskTyp">
                {{'HDD_TYPE' | translate}}:
            </ion-label> {{asset.hardDiskTyp}}
            <ion-label color="primary" *ngIf="asset.opticalDriveType">


            {{'OPTICAL_DRIVE' | translate}}:
                </ion-label> {{asset.opticalDriveType}}
...... something similar goes on

Try to find out:


Solution

  • If I take the if Statement out of the content everything works ... Whatever

    <ng-container *ngIf="asset$ | async as asset">
        <ion-content>
          ....