blob: 71cf93ce4c64a1d81fcbe164e1ae116e97c429c8 (
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
|
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';
@Component({
selector: 'app-predict',
templateUrl: './predict.component.html',
styleUrls: ['./predict.component.css']
})
export class PredictComponent implements OnInit {
inputs : String[] = [];
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;
console.log(this.predictor);
})
});
}
usePredictor(): void{
this.predictS.usePredictor(this.predictor, this.inputs).subscribe(p => {
alert("Prediktor je uspesno poslat na treniranje!");
})
console.log(this.inputs);
}
}
|