blob: 1c1c742568c4ce7595cdaa9b2353de702a25636f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import Predictor from 'src/app/_data/Predictor';
import { PredictorsService } from 'src/app/_services/predictors.service';
import shared from 'src/app/Shared';
@Component({
selector: 'app-predict',
templateUrl: './predict.component.html',
styleUrls: ['./predict.component.css']
})
export class PredictComponent implements OnInit {
inputs : Column[] = [];
predictor:Predictor;
constructor(private predictS : PredictorsService, private route: ActivatedRoute) {
this.predictor = new Predictor();
}
ngOnInit(): void {
this.route.params.subscribe(url => {
this.predictS.getPredictor(url["id"]).subscribe(p => {
this.predictor = p;
this.predictor.inputs.forEach((p,index)=> this.inputs[index] = new Column(p, ""));
console.log(this.predictor);
})
});
}
usePredictor(): void{
this.predictS.usePredictor(this.predictor, this.inputs).subscribe(p => {
shared.openDialog("Obaveštenje", "Prediktor je uspešno poslat na probu."); //pisalo je "na treniranje" ??
})
console.log(this.inputs);
}
}
export class Column {
constructor(
public name : string,
public value : (number | string)){
}
}
|