import { Component, OnInit, Inject } from '@angular/core';
import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material';
import { ContactService } from '../../contact.service';

declare var moment: any, _: any, $: any;
@Component({
  selector: 'app-order-details',
  templateUrl: './order-details.component.html',
  styleUrls: ['./order-details.component.scss']
})

export class OrderDetailsComponent implements OnInit {
  orderDetail:any=[];
  orderInDetails:any=[]
  constructor(public dialogRef: MdDialogRef<OrderDetailsComponent>,@Inject(MD_DIALOG_DATA) public data: any,private contactService: ContactService) { 
    this.orderInDetails = data;
    this.orderDetail  = this.data.CartData ;
    console.log("this.payloadObj",this.orderDetail); 
  }

  ngOnInit() {
    
  }
  showttl(tbl) {
    return tbl.length > 0
      ? _.chain(tbl)
          .map((d) => {
            d.ttl = d.price * d.quantity;
            return d;
          })
          .map("ttl")
          .sum()
          .value()
      : 0;
  }

}
