Mercurial > hg > ugly-duckling
diff src/app/feature-extraction-menu/feature-extraction-menu.component.ts @ 44:13f5f228ed98
Add a component for the feature extraction menu, and start setting up some comms with the worker. Currently populating a select box with list of extractors from hardcoded server.
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Fri, 02 Dec 2016 16:55:14 +0000 |
parents | |
children | 88052122ec01 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/app/feature-extraction-menu/feature-extraction-menu.component.ts Fri Dec 02 16:55:14 2016 +0000 @@ -0,0 +1,32 @@ +import {Component, OnInit} from '@angular/core'; +import {FeatureExtractionService} from "../services/feature-extraction/feature-extraction.service"; + +interface ExtractorInfo { + key: string; + name: string; +} + +@Component({ + selector: 'app-feature-extraction-menu', + templateUrl: './feature-extraction-menu.component.html', + styleUrls: ['./feature-extraction-menu.component.css'] +}) +export class FeatureExtractionMenuComponent implements OnInit { + + extractors: ExtractorInfo[]; + + constructor(private piperService: FeatureExtractionService) { + this.extractors = []; + } + + ngOnInit() { + this.piperService.list().then(available => { + available.available.forEach(staticData => this.extractors.push({ + key: staticData.key, + name: staticData.basic.name + }) + ); + }); + } + +}