Angular2 - How to create a simple table

I need to know the best practice to use in this scenario:

I have a WebApi that returns a tabular dataset and I have to show it using loading tables ...

How to implement it? Which bootstrap component should I use?

The table is very simple, it displays only a few data and a button to go to the details of the row ...

Thanks to support

+6
source share
2 answers

Here is an example of a simple table that will redirect you to the details of clicking on a row:

<table class="table table-hover">
    <thead>
        <tr>
            <td>Id</td>
            <td>Title</td>
            <td>Amount</td>
        </tr>
    </thead>
    <tbody>
        <tr *ngFor="let transfer of transfers" [routerLink]="['/transfer']" [queryParams]="{ id: transfer.id }">
            <td>{{transfer.id}}</td>
            <td>{{transfer.title}}</td>
            <td>{{transfer.amount}}</td>
        </tr>
    </tbody>
</table> 

I suggested that you work with an array transfersand redirect based id.

+7
source

Bootstrap angular 2. URL

, Teradata.

, : ,

+2

Source: https://habr.com/ru/post/1016289/


All Articles