import { Component, OnInit } from '@angular/core';
import {MdDialog, MdDialogRef, MD_DIALOG_DATA} from '@angular/material';
import {GmapComponent} from '../gmap/gmap.component';
import {RuleComponent} from '../rule/rule.component';
import { ExpansionPanelsModule } from 'ng2-expansion-panels';
import { DateTimePickerModule } from 'ng-pick-datetime';
import { DatepickerModule as YourAlias } from 'angular2-material-datepicker'
@Component({
  selector: 'app-details',
  templateUrl: './details.component.html',
  styleUrls: ['./details.component.css']
})
export class DetailsComponent implements OnInit {
  animal: string;
  name: string;
  foods = [
    {value: 'SMS', viewValue: 'SMS'},
    {value: 'Email', viewValue: 'Email'},
    {value: 'Push', viewValue: 'Push Notification'},
  ];
  foodss = [
    {value: 'Daily', viewValue: 'Daily'},
    {value: 'Weekly', viewValue: 'Weekly'},
    {value: 'Monthly', viewValue: 'Monthly'},
    {value: 'Yearly', viewValue: 'Yearly'},
  ];
  delete(){
    // console.log("DELETE RUNNING");
  }
  constructor(public dialog: MdDialog) { }
  openDialog(): void {
    let dialogRef = this.dialog.open(GmapComponent, {
      width: '400px',
      data: { name: "1234567890", animal: this.animal }
    });
    dialogRef.afterClosed().subscribe(result => {
      // console.log('The dialog was closed');
      this.animal = result;
      // console.log(this.animal);
      this.l.push(this.animal)
    });
  }
  openDialog2(): void {
    let dialogRef = this.dialog.open(RuleComponent, {
      width: '700px',
      //data: { name: "1234567890", animal: this.animal }
    });
    dialogRef.afterClosed().subscribe(result => {
      // console.log('The dialog was closed');
     // this.animal = result;
     // console.log(this.animal);
     // this.l.push(this.animal)
    });
  }
 l :any;
  logout(){

  }
  resetForm(){

  }
  saveForm(){
    
  }
  addContact(){
    
  }
  neww:any;
  yourModelDate:any;
  fs:any;
  ls:any;
  or:any
  ngOnInit() {
    this.fs=1;
    this.ls=2;
    this.or=3
  }

}
