1 pièce(s) jointe(s)
Actualiser une partie de page
bonsoir,
J'ai les codes suivantes:
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| ngOnInit() {
this.article = new Article();
this.getRandomArticles();
}
getRandomArticles(): void {
this.articleservice.getRandomArticles()
.subscribe(article => {
console.log(article);
this.article = article;
}); |
Et dans le fichier html j'ai:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| <div class="container">
<table class="table table-striped">
<thead>
<th>Code</th>
<th>Libelle</th>
<th>Prix</th>
<th>Description</th>
</thead>
<tbody>
<tr >
<td>{{article.code}}</td>
<td>{{article.libelle}}</td>
<td>{{article.prix}}</td>
<td>{{article.description}}</td>
</tr>
</tbody>
</table>
</div> |
J'ai cette image:
Pièce jointe 411593
Quand je charge ma page, l'article dans le tableau change mais je veux que l'article dans le tableau change sans que je ne charge la page, comment puis je faire?
Merci