我正在使用这个伟大的
angular2-modal,但无法弄清楚如何从我的自定义模式返回结果值.
我像这样实例化它:
let dialog: Promise<ModalDialogInstance>; let bindings = Injector.resolve([ provide(ICustomModal,{ useValue: this.gewaehltesBild }) ]); var self = this; dialog = this.modal.open( <any>ImagecropperComponent,bindings,new ModalConfig("md",true,27)); dialog.then((resultPromise) => { return resultPromise.result.then((result) => { this.lastModalResult = result; this.mitarbeiter.avatarImg = this.gewaehltesBild; $(self.elementRef.nativeElement).find('#bildSelector').val(""); },() => this.lastModalResult = 'Rejected!'); });
我试图发送我的returnvalue
this.dialog.close(this.croppedImage);
但结果总是为空. angular2中是否有一个约定如何从组件返回值,即angular2-modal?
谢谢!