import { LoadingService } from '@farris/ui-loading'; import { Subject } from 'rxjs/Subject'; import { Observable } from 'rxjs/Observable'; import { Component, Renderer2, TemplateRef, ViewChild, ComponentFactoryResolver, Injector, ComponentRef, ElementRef } from '@angular/core'; import { BsModalService } from '../../../../../projects/modal/src/public-api'; import { MessagerService } from '../../../../../projects/messager/src/public-api'; import { BsModalRef } from '../../../../../projects/modal/src/public-api'; import { DialogContentComponent } from './dialog-content.component'; import { of } from 'rxjs/observable/of'; @Component({ selector: 'app-dialog-demo', templateUrl: `./dialog-demo.component.html` }) export class DialogDemoComponent { showIframe(){ this.modalService.show('http://m.baidu.com', { title: 'iframe', width: 500, height: 600, // buttons: this.btnRef, showButtons: false, dialogType: 'iframe', beforeClose: () => { const canClose = new Subject(); this.msgService.question('确认要关闭此窗口吗? 亲.', () => { canClose.next(true); }, () => { canClose.next(false); }); return canClose.asObservable(); } }); } }