import { Component, ViewChild, Injector, Output, EventEmitter } from '@angular/core'; import { ModalDirective } from 'ngx-bootstrap'; import { AppComponentBase } from '@shared/common/app-component-base'; import { OrderNotificationsServiceProxy, OrderNotificationDto,TestNotificationInput } from '@shared/service-proxies/service-proxies'; // TestNotificationInput @Component({ selector: 'testNotificationModalComponent', templateUrl: './test-notification.component.html' }) export class TestNotificationComponent extends AppComponentBase { @ViewChild('testNotificationModal', { static: true }) modal: ModalDirective; @Output() modalSave: EventEmitter = new EventEmitter(); active = false; saving = false; data:TestNotificationInput = new TestNotificationInput(); email:string; phone:string; constructor( injector: Injector, private _orderNotificationsServiceProxy: OrderNotificationsServiceProxy, ) { super(injector); } show(): void { this.active = true; this.modal.show(); } close(): void { this.active = false; this.modal.hide(); } send():void{ this.spinnerService.show(); this.data.emailAddress = (document.getElementById('test_email')).value; this.data.phoneNumber = (document.getElementById('test_sms')).value; this._orderNotificationsServiceProxy.testNotification(this.data).subscribe( result =>{ this.spinnerService.hide() this.notify.success(this.l('Success!')); this.active = false; this.modal.hide(); }); } }