How the components communicate with each other
https://github.com/ardiadrianadri/basicCourse/releases/tag/final_volume_1_section_3
A table:
Input parameters
Metadata:
[{
header: <Header of the table comlumn>
key: <Name of the attribute, which value will be in the column>
},...]
Input parameters
Table Object:
{
totalNumber: <Number of the results>
page: <Number of the current page>
totalPages: <Number of pages>
size: <Size of the pages>
data: <Array with the result of the search for the current page>
}
Example:
Metadata
[{header: 'Name', key:'name'},{header:'Email', key: 'email'}]
Table object
{
totalNumber: 2,
page: 1,
size: 5,
totalPages: 1,
data: [{name:'Adrian', email:'ardiadrianadri@gmail.com'},
{name: 'Victor', email:'victorVice@gmail.com'}]
}
Use the ngFor directevie:
https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html