Last active
July 1, 2022 09:37
Revisions
-
DmitryEfimenko revised this gist
Jul 1, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class MyComponent { this.loadProducts(); } loadProducts() { this.http.get('/api/products').subscribe((products) => { this.products = products; }) -
DmitryEfimenko created this gist
Jul 1, 2022 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ @Component({ selector: 'app-products', template: ` <button (click)="loadProducts()">Load Products</button> <ng-container *ngFor="let product of products"> <app-product [product]="product"></app-product> </ng-container> ` }) class MyComponent { products: Product[]; ngOnInit() { this.loadProducts(); } private loadProducts() { this.http.get('/api/products').subscribe((products) => { this.products = products; }) } }