<form>
<div id="cartItemsList">
<ul>
<li *ngFor="let product of products">
<div>{{product.name }}</div>
<div><img src="../assets/images/gallery/{{product.thumbnail}}" /></div>
<div>{{product.price }}</div>
<button type="button" class="btnAddAction">Add to Cart</button>
</li>
</ul>
</div>
</form>
import { Component, OnInit } from '@angular/core';
import { AngularFireDatabase, AngularFireList } from 'angularfire2/database';
import { Observable } from 'rxjs';
import * as firebase from 'firebase/app';
@Component({
selector: 'app-shopping-cart',
templateUrl: './shopping-cart.component.html',
styleUrls: ['./shopping-cart.component.scss']
})
export class ShoppingCartComponent implements OnInit {
products: any[];
constructor(public db: AngularFireDatabase){
db.list('/products')
.valueChanges().subscribe(products=>{
this.products=products;
});
}
ngOnInit(): void {
}
}
--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/angular/5b5cfedc-3a5e-42b9-ba0d-1d0136e1b79do%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ang...@googlegroups.com.
Thanks,Nitin GuptaSoftware Architect/DeveloperLinked In Profile: www.linkedin.com/in/ngpsi/359 Lakeshore DrivePleasantville, NY 10570
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/angular/aa7a75a7-4864-419e-8fa4-981b7f38538bo%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/angular/aa7a75a7-4864-419e-8fa4-981b7f38538bo%40googlegroups.com.