import { Component, OnInit, Inject } from '@angular/core';
import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material';

@Component({
  selector: 'app-sosalert',
  templateUrl: './sosalert.component.html',
  styleUrls: ['./sosalert.component.scss']
})
export class SOSAlertComponent implements OnInit {
  alertmsg:any;
  vehicle_num:any;
  alertMessage: any;
  alertType: any;

  constructor(public thisDialogRef: MdDialogRef<SOSAlertComponent>, @Inject(MD_DIALOG_DATA) public data: any) {
    this.alertmsg = data.socketData;
    console.log("alert Object", this.alertmsg);
    this.vehicle_num = this.alertmsg.vehicleName;
    this.alertMessage = this.alertmsg.item.sentence;
    this.alertType = this.alertmsg.item._type ;
   }

  ngOnInit() {
  }

  closePopup(){
    this.thisDialogRef.close("success");
  }

}
