import {Component,OnInit, ElementRef, NgZone, ViewChild} from '@angular/core';
import { trigger, transition, animate, style } from '@angular/animations';
import {MyserviceService} from '../myservice.service'
@Component({
  selector: 'app-immunizations',
  templateUrl: './immunizations.page.html',
  styleUrls: ['./immunizations.page.scss'],
})
export class ImmunizationsPage implements OnInit {
  shownGroup= null;
  immunization_data:any;
  constructor(private myservice:MyserviceService) { 
    this.shownGroup = 0;
    this.immunization_data = {
      "message":"success",
      "data" : [
      {
      "type":"HIB",
      "last_adminstered_date":"05/14/2019",
      "status":"Deficient",
      },
      {
      
        "type":"MMR",
      "last_adminstered_date":"05/14/2019",
      "status":"Deficient",
      }
      ]
      };
      this.get_immunization();
  }

  ngOnInit() {
  }
  isGroupShown(group) {
    return this.shownGroup === group;
    }
    toggleGroup(group) {
      if (this.isGroupShown(group)) {
      this.shownGroup = null;
      } else {
      this.shownGroup = group;
      }
      }

get_immunization() {
  this.immunization_data = this.myservice.ObjArray(this.immunization_data.data);
}
}
