You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
647 B
28 lines
647 B
import { Component, OnInit } from '@angular/core';
|
|
import { ProductService } from './../../services/product.service';
|
|
import { Observable } from 'rxjs';
|
|
import { Product } from './../../models/product';
|
|
|
|
@Component({
|
|
selector: 'app-home',
|
|
templateUrl: './home.component.html',
|
|
styleUrls: ['./home.component.css']
|
|
})
|
|
export class HomeComponent implements OnInit {
|
|
showButton(){
|
|
alert("show cart clicked")
|
|
}
|
|
|
|
addCart(){
|
|
alert("added to cart")
|
|
}
|
|
|
|
products:Observable<Product[]>
|
|
constructor(private productservice: ProductService) {
|
|
this.products = this.productservice.showAllProduct();
|
|
}
|
|
|
|
ngOnInit(): void {
|
|
}
|
|
|
|
}
|