aboutsummaryrefslogtreecommitdiff
path: root/sandbox/test-projekat-danijel/frontend/src/app/page-one/page-one.component.ts
blob: 93964644179c33ece5593d30a18802f3f0ab7aa9 (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
import { Component, OnInit } from '@angular/core';
import { ValuesService } from '../values.service';
import { NgModel } from '@angular/forms';
import { Router } from '@angular/router';

@Component({
  selector: 'app-page-one',
  templateUrl: './page-one.component.html',
  styleUrls: ['./page-one.component.css']
})
export class PageOneComponent implements OnInit {

  red: number = 255;
  green: number = 255;
  blue: number = 255;

  color = '#ffffff';

  constructor(private values: ValuesService, private router: Router) { }

  ngOnInit(): void {
  }

  submit() {
    console.log(this.red + ':' + this.green + ':' + this.blue);
    this.values.addColor(this.red, this.green, this.blue).subscribe((color) => {
      console.log(color);
      this.color = color;
    })
  }

  goToColors() {
    this.router.navigate(['boje'])
  }

}