import { Component, OnInit } from '@angular/core'; import { ProductsService } from '../../services/products/products.service'; import { CookieService } from 'ngx-cookie-service'; @Component({ selector: 'app-export-products', templateUrl: './export-products.component.html', styleUrls: ['./export-products.component.scss'] }) export class ExportProductsComponent implements OnInit { companyId: number; actionType: string = "DEFAULT"; constructor(private productService: ProductsService, private cookieService: CookieService) { } ngOnInit() { this.companyId = +this.cookieService.get('CompanyId'); } //Export products exportProducts(){ this.productService.ExportProducts(this.companyId, this.actionType) .subscribe(res => { }, error => console.log("Error", error)) } }