import { NgModule } from '@angular/core';import { CommonModule } from '@angular/common';import { FormsModule } from '@angular/forms';import { MaterialModule } from '@angular/material';
import { ViewComponent } from './view.component';import { ListViewComponent } from './list-view/list-view.component';
import { TestDialog } from './dialogs/add-subscription/add-subscription.dialog';
@NgModule({ declarations: [ ViewComponent, ListViewComponent, DetailViewComponent,
TestDialog ], imports: [ CommonModule, FormsModule, MaterialModule,
ViewRoutingModule ], entryComponents: [TestDialog]})export class TestModule { }import { Component, OnInit } from '@angular/core';import { MdDialog, MdDialogRef } from '@angular/material/dialog'
import { TestDialog } from '../dialogs/test/test.dialog'
@Component({ selector: 'app-list-view', templateUrl: './list-view.component.html', styleUrls: ['./list-view.component.css']})export class ListViewComponent { testDialog: MdDialogRef<TestDialog>
constructor(public dialogs: MdDialog) { }
addSubscription(): void { this.testDialog = this.dialogs.open(TestDialog, { disableClose: false });
this.testDialog.afterClosed().subscribe(result => console.log(result)); }}import { Component } from '@angular/core';import { MdDialogRef } from '@angular/material/dialog';
@Component({ selector: 'test-dialog', templateUrl: './test.dialog.html', styleUrls: ['./test.dialog.css']})export class TestDialog { constructor(public dialogRef: MdDialogRef<TestDialog>) { }}