I am using this big angular2-modal but cannot figure out how to return the result value from my custom modal code.
I create it like this:
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!'); });
I tried sending my return value using
this.dialog.close(this.croppedImage);
but the result is always zero. Is there a convention in angular2 how to return values ββfrom components that are used by angular2 -modal?
Thanks!
source share