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";

@Component({
  selector: "app-set001-view-site",
  templateUrl: "./set001-view-site.component.html"
})
export class Set001ViewSiteComponent implements OnInit {
  errorMessage: String;
  data: any;

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

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

  ngOnInit() {
    this.loading = true;

    this.route.data.subscribe((data: { selectedItem: any }) => {
      this.loading = false;
      this.selectedItem = data.selectedItem;
    });
  }


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