How do I display the Id and the date in Angular (as my frontend) from the SQL server?

Discussão em 'Angular' iniciado por ryuk, Fevereiro 13, 2025.

  1. ryuk

    ryuk Guest

    {
    "data": [
    {
    "id": "00000000-0000-0000-0000-000000000000",
    "recipientName": "princess",
    "recipientEmail": "princess@gmail.com",
    "senderName": "kira",
    "senderEmail": "kira@gmail.com",
    "dedication": "",
    "voucher": "3000",
    "orderedAt": "0001-01-01T00:00:00"
    }
    ],
    "message": "",
    "errorCode": "",
    "statusCode": 200
    }



    This is what I got from POSTMAN when I tried to GET data from the database (SQL Server). This is also what displays in my frontend (Angular). However, the Id and the orderedAt is different from what is stored in database. In database, Id is a long string while orderedAt displays the right date and time.

    My question is, how do I display the right data to Angular from the database? And why did these happened? Is this sort of "encryption"?

    NOTE: I used VS 2019 (.NET Core) as my backend and VS Code as my frontend.

    <tr *ngFor = "let order of orders">

    <!-- <td>{{order.id}}</td> -->
    <td>{{order.recipientName}}</td>
    <td>{{order.recipientEmail}}</td>
    <td>{{order.senderName}}</td>
    <td>{{order.senderEmail}}</td>
    <td>{{order.dedication}}</td>
    <td>{{order.voucher}}</td>
    <td>{{order.orderedAt}}</td>
    </tr>


    This is what's written in my html (in Angular) to display the data.

    Continue reading...

Compartilhe esta Página