aboutsummaryrefslogtreecommitdiff
path: root/sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.ts')
-rw-r--r--sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.ts25
1 files changed, 25 insertions, 0 deletions
diff --git a/sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.ts b/sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.ts
new file mode 100644
index 00000000..f30bf9e2
--- /dev/null
+++ b/sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.ts
@@ -0,0 +1,25 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { ValuesService } from '../values.service';
+
+@Component({
+ selector: 'app-page-two',
+ templateUrl: './page-two.component.html',
+ styleUrls: ['./page-two.component.css']
+})
+export class PageTwoComponent implements OnInit {
+
+ colors?: string[];
+
+ constructor(private values: ValuesService, private router: Router) { }
+
+ ngOnInit(): void {
+ this.values.getColors().subscribe((colors) => {
+ this.colors = colors;
+ })
+ }
+
+ goToAddColor() {
+ this.router.navigate(['']);
+ }
+}