import { Component , OnInit , ViewEncapsulation , OnDestroy } from '@angular/core' ; import { Room } from '../common/data.model' ; import { MatDialogRef } from '@angular/material' ; @ Component ( { selector : 'app-new-room' , templateUrl : './room-metadata.component.html' , styleUrls : [ './room-metadata.component.scss' ] , encapsulation : ViewEncapsulation . None } ) export class RoomMetadataComponent implements OnInit , OnDestroy { newRoom : Room ; constructor ( public dialogRef ) { this . newRoom = { } ; } ngOnInit ( ) { } ngOnDestroy ( ) { } save ( evt ) { this . newRoom . type = 'public' ; this . dialogRef . close ( this . newRoom ) ; } cancel ( evt ) { this . dialogRef . close ( ) ; } }