import { SetDataService } from "../../../service/set-data.service";
import { Router } from "@angular/router";
import { Component, OnInit } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { HelperService } from "app/service/helper.service";
import { CompanyInformationData } from "../../../data/CompanyInformationData";

@Component({
  selector: "app-set003-view-vendor",
  templateUrl: "./set003-view-vendor.component.html"
})
export class Set003ViewVendorComponent implements OnInit {
  errorMessage: String;
  data: any;
  companyInformationData: CompanyInformationData;

  selectedItem: any;
  itemId: number;
  loading = false;

  constructor(
    private setDataService: SetDataService,
    private route: ActivatedRoute,
    private router: Router,
    private helperService: HelperService
  ) {}

  ngOnInit() {
    this.loading = true;
    this.companyInformationData = new CompanyInformationData();
    this.route.data.subscribe((data: { selectedItem: any }) => {
      this.loading = false;
      this.selectedItem = data.selectedItem;
    });
  }

  backPreviousPage() {
    this.router.navigateByUrl("/set/set003");
  }
}
