import { Component, OnInit, Inject } from '@angular/core';
import { ApiService } from 'app/api.service';
import { Title } from '@angular/platform-browser';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';

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

  public x: any = {
    id: '',
    msg: ''
  }
  constructor(private title: Title, public apiService: ApiService, public dialogRef: MatDialogRef<UsersMessageComponent>, @Inject(MAT_DIALOG_DATA) public data: any) {
    this.x.id = data.id;
  }

  ngOnInit() {

  }
  save() {
    this.apiService.sendPush(this.x).subscribe((data:any) => {
      
    });
    this.dialogRef.close();
  }
  dismiss() {
    this.dialogRef.close();
  }

}
