diff options
Diffstat (limited to 'sandbox/test-projekat-danijel/frontend/src/app/page-two')
4 files changed, 57 insertions, 0 deletions
| diff --git a/sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.css b/sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.css new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.css diff --git a/sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.html b/sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.html new file mode 100644 index 00000000..24719f71 --- /dev/null +++ b/sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.html @@ -0,0 +1,7 @@ +<button type="button" (click)="goToAddColor()">DODAJ BOJU</button><br><br> + +<div style="display: flex; flex-direction: column-reverse;" *ngIf="colors"> +    <div *ngFor="let color of colors" [style.backgroundColor]="color" style="width: 100%; height: 100px;"> + +    </div> +</div>
\ No newline at end of file diff --git a/sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.spec.ts b/sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.spec.ts new file mode 100644 index 00000000..e5086adb --- /dev/null +++ b/sandbox/test-projekat-danijel/frontend/src/app/page-two/page-two.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PageTwoComponent } from './page-two.component'; + +describe('PageTwoComponent', () => { +  let component: PageTwoComponent; +  let fixture: ComponentFixture<PageTwoComponent>; + +  beforeEach(async () => { +    await TestBed.configureTestingModule({ +      declarations: [ PageTwoComponent ] +    }) +    .compileComponents(); +  }); + +  beforeEach(() => { +    fixture = TestBed.createComponent(PageTwoComponent); +    component = fixture.componentInstance; +    fixture.detectChanges(); +  }); + +  it('should create', () => { +    expect(component).toBeTruthy(); +  }); +}); 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(['']); +  } +} | 
