Mercurial > hg > ugly-duckling
diff src/app/feature-extraction-menu/feature-extraction-menu.component.ts @ 426:8fee76ab8e90
Take a callback as a prop for performing an action when requesting an output
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Tue, 06 Jun 2017 22:11:59 +0100 |
parents | 4387175f594b |
children | 686cf74aa0a2 |
line wrap: on
line diff
--- a/src/app/feature-extraction-menu/feature-extraction-menu.component.ts Tue Jun 06 21:37:10 2017 +0100 +++ b/src/app/feature-extraction-menu/feature-extraction-menu.component.ts Tue Jun 06 22:11:59 2017 +0100 @@ -40,6 +40,7 @@ get disabled() { return this.isDisabled; } + @Input() onRequestOutput: () => void; @Output() requestOutput: EventEmitter<ExtractorOutputInfo>; @@ -86,9 +87,10 @@ } extract(info: ExtractorOutputInfo): void { - console.warn('extract?', info); + if (this.onRequestOutput) { + this.onRequestOutput(); + } if (info) { - console.warn('emit'); this.requestOutput.emit(info); } }