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.
 
 
 
 
 

21 lines
507 B

import { Component, OnInit } from '@angular/core';
import { CartService } from 'src/app/service/cart.service';
@Component({
selector: 'app-cart',
templateUrl: './cart.component.html',
styleUrls: ['./cart.component.css']
})
export class CartComponent implements OnInit {
cartNo:number = 0;
uid:string = "10";
constructor(private cartService:CartService) { }
ngOnInit(): void {
this.cartService.getCartByUser(this.uid).subscribe(data1 => {
this.cartNo = data1.length;
})
}
}