import { Component, OnInit } from '@angular/core';
import { Plant } from 'src/app/models/plant';
import { PlantsService } from 'src/app/services/plants.service';

@Component({
  selector: 'app-plants-status',
  templateUrl: './plants-status.component.html',
  styleUrls: ['./plants-status.component.scss']
})
export class PlantsStatusComponent implements OnInit {

  listData: Plant[];
  plantId: number;

  constructor(private plantsService: PlantsService) {
  }

  ngOnInit() {
    this.plantsService.getPlants().subscribe(res => {
      this.listData = res;
    });
  }

  sendPlantId(id: number) {
    this.plantId = id;
  }

}
