diff --git a/src/app/packages/sensor/component/setting/setting.component.ts b/src/app/packages/sensor/component/setting/setting.component.ts index 14d667c..03c2323 100644 --- a/src/app/packages/sensor/component/setting/setting.component.ts +++ b/src/app/packages/sensor/component/setting/setting.component.ts @@ -7,7 +7,7 @@ import { AfterContentInit } from '@angular/core/src/metadata/lifecycle_hooks'; templateUrl: './setting.component.html', styleUrls: ['./setting.component.scss'] }) -export class SettingComponent implements OnInit, AfterContentInit { +export class DiscoverySettingComponent implements OnInit, AfterContentInit { constructor() { } diff --git a/src/app/packages/sensor/sensor.module.ts b/src/app/packages/sensor/sensor.module.ts index 88f07b2..d675b58 100644 --- a/src/app/packages/sensor/sensor.module.ts +++ b/src/app/packages/sensor/sensor.module.ts @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { MaterialModule } from 'app/commons/ui/material/material.module'; -import { SettingComponent } from 'app/packages/sensor/component/setting/setting.component'; +import { DiscoverySettingComponent } from 'app/packages/sensor/component/setting/setting.component'; import { SettingResultComponent } from 'app/packages/sensor/component/setting-result/setting-result.component'; import {FormsModule} from '@angular/forms'; @@ -14,11 +14,11 @@ import {FormsModule} from '@angular/forms'; FormsModule ], declarations: [ - SettingComponent, + DiscoverySettingComponent, SettingResultComponent, ], exports: [ - SettingComponent, + DiscoverySettingComponent, SettingResultComponent ] }) diff --git a/src/app/pages/sensor-setting/sensor-setting-page.component.ts b/src/app/pages/sensor-setting/sensor-setting-page.component.ts index 45c7799..023b9c3 100644 --- a/src/app/pages/sensor-setting/sensor-setting-page.component.ts +++ b/src/app/pages/sensor-setting/sensor-setting-page.component.ts @@ -1,5 +1,9 @@ import { Component, OnInit } from '@angular/core'; +import {MatDialog} from '@angular/material'; +import { DiscoverySettingComponent } from 'app/packages/sensor/component/setting/setting.component'; + + @Component({ selector: 'of-sensor-setting-page', templateUrl: './sensor-setting-page.component.html', @@ -7,11 +11,24 @@ import { Component, OnInit } from '@angular/core'; }) export class SensorSettingPageComponent implements OnInit { - constructor() { } + constructor(public dialog: MatDialog) { } step = 1; ngOnInit() { + + } + + openDialog(): void { + const dialogRef = this.dialog.open(DiscoverySettingComponent, { + width: '850px', + data: 'this text is dialog!!' + }); + + dialogRef.afterClosed().subscribe(result => { + console.log('The dialog was closed'); + + }); } onNext() { @@ -21,6 +38,7 @@ export class SensorSettingPageComponent implements OnInit { onCloseCancel() { // this.dialogRef.close('Cancel'); + this.openDialog(); } diff --git a/src/app/pages/sensor-setting/sensor-setting-page.module.ts b/src/app/pages/sensor-setting/sensor-setting-page.module.ts index 2f11c6f..9477ed7 100644 --- a/src/app/pages/sensor-setting/sensor-setting-page.module.ts +++ b/src/app/pages/sensor-setting/sensor-setting-page.module.ts @@ -6,13 +6,21 @@ import { SensorModule } from 'app/packages/sensor/sensor.module'; import { MaterialModule } from 'app/commons/ui/material/material.module'; +import { FormsModule } from '@angular/forms'; +import { DiscoverySettingComponent } from 'app/packages/sensor/component/setting/setting.component'; + + @NgModule({ imports: [ CommonModule, MaterialModule, SensorSettingPageRoutingModule, - SensorModule + SensorModule, + FormsModule, + ], + entryComponents: [ + DiscoverySettingComponent ], declarations: [SensorSettingPageComponent] })