diff options
Diffstat (limited to 'sandbox/test-projekat-danijel/frontend/src/app/page-one/page-one.component.ts')
-rw-r--r-- | sandbox/test-projekat-danijel/frontend/src/app/page-one/page-one.component.ts | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/sandbox/test-projekat-danijel/frontend/src/app/page-one/page-one.component.ts b/sandbox/test-projekat-danijel/frontend/src/app/page-one/page-one.component.ts new file mode 100644 index 00000000..93964644 --- /dev/null +++ b/sandbox/test-projekat-danijel/frontend/src/app/page-one/page-one.component.ts @@ -0,0 +1,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']) + } + +} |