import { Component, OnInit } from '@angular/core'; import { Orderdto } from 'src/app/model/Orderdto'; import { CartService } from 'src/app/service/cart.service'; declare const calc:any @Component({ selector: 'app-order', templateUrl: './order.component.html', styleUrls: ['./order.component.css'] }) export class OrderComponent implements OnInit { public products : any = []; orderdto!:Orderdto[]; public grandTotal : any; uid!:any; constructor(private cartService:CartService) { } ngOnInit(): void { this.uid = window.sessionStorage.getItem('userid'); this.cartService.getOrder(this.uid).subscribe(res=>{ this.orderdto = res; }) this.cartService.getordersumByUid(this.uid).subscribe(data=>{ this.grandTotal=data; }) } }