aboutsummaryrefslogtreecommitdiff
path: root/sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.ts
blob: f30bf9e203ffec340b9dc24147a58e080cb9d89f (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
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(['']);
  }
}