1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Displaying all values of the variable NUM line by line in an HTML table

Discussão em 'Angular' iniciado por juliette, Setembro 30, 2024.

  1. juliette

    juliette Guest

    I would like all the values of the variable NUM to be displayed line by line in the HTML table, do you know how I could do that?

    Here is the JSON file:

    {

    {
    "DOSTT": 973053215042,
    "INTITULE1": "YCONS",
    "PHONE": "0999999999999",
    "TOMANY": "FALSE",
    "PREPTF": [
    {
    "NUM": 2555452,
    "DOSTT": 973053215042,
    "SVM": 347075,
    "ISIN": "BE0003470755",
    "LABEL": "SOLVAY BE",
    "QUANTITE": 100.00,
    "DATE": "2024-09-30",
    "TYPE": "IN",
    "PERSONNE_CONTACT": "ttt",
    "CONTREPARTIE": "tt",
    "TEL": 11,
    "FAX": 0,
    "STATUT": 1,
    "STATUT_LIB": "Encodé",
    "REF_ALPHA": "",
    "REF_RBC": "",
    "TRADE_DATE": "0001-01-01",
    "VALUE_DATE": "0001-01-01",
    "TRAITEMENT_DATE": "0001-01-01",
    "ANNULATION_DATE": "0001-01-01",
    "RECEPTION_DATE": "0001-01-01",
    "REM1": "777",
    "REM2": "777",
    "COURS_MOYEN_ACHAT": 33.930000,
    "ACHAT_DATE": "2024-09-30",
    "PMBIS": "N",
    "TIS": 0.000000,
    "CHANGEMENT_BENEF_ECO": "O"
    },
    {
    "NUM": 2555453,
    "DOSTT": 973053215042,
    "SVM": 10126089,
    "ISIN": "FR0000120628",
    "LABEL": "AXA",
    "QUANTITE": 100.00,
    "DATE": "2024-09-30",
    "TYPE": "IN",
    "PERSONNE_CONTACT": "ttt",
    "CONTREPARTIE": "tt",
    "TEL": 11,
    "FAX": 0,
    "STATUT": 1,
    "STATUT_LIB": "Encodé",
    "REF_ALPHA": "",
    "REF_RBC": "",
    "TRADE_DATE": "0001-01-01",
    "VALUE_DATE": "0001-01-01",
    "TRAITEMENT_DATE": "0001-01-01",
    "ANNULATION_DATE": "0001-01-01",
    "RECEPTION_DATE": "0001-01-01",
    "REM1": "777",
    "REM2": "777",
    "COURS_MOYEN_ACHAT": 32.050000,
    "ACHAT_DATE": "2024-09-30",
    "PMBIS": "N",
    "TIS": 0.000000,
    "CHANGEMENT_BENEF_ECO": "O"
    }
    ]
    }
    ...
    ],
    "RETURNLIST": []
    }


    My html preview :S

    [​IMG]

    template

    <ng-container *ngIf="PRE && PRE.length > 0">
    <table>
    <tr *ngFor="let preItem of PRE">
    <td *ngFor="let prePtfItem of preItem.PREPTF">
    {{ prePtfItem.NUM}}
    </td>
    </tr>
    </table>
    </ng-container>


    interface.ts

    import { ApiResponse } from "src/shared/types/api.response";

    export interface PREItem extends ApiResponse {
    DOSTT: any;
    INTITULE1: string;
    PHONE: string;
    PREPTF: PREPTFItem[];
    }

    export interface PREPTFItem {
    LABEL: string;
    TYPE: string;
    QUANTITE: number;
    STATUT: number;
    NUM: number;
    ISIN: string;
    STATUT_LIB: string;
    REF_RBC: string;

    }



    Here is the logic

    overviewTransfers(account: string): void {
    this.service.overviewTransfers(account).pipe(
    takeUntil(this.unsubscribe$)
    ).subscribe(res => {
    if (res.RETURNCODE === ApiResponseCodeEnum.Ok) {
    this.PRE = res["PRE"];
    }
    });
    }


    Thank you for your help.

    Continue reading...

Compartilhe esta Página