source: Sources/frontend/src/app/category/category.component.ts

Last change on this file was 8423429, checked in by AngelNasev <angel.nasev@…>, 17 months ago

Add backend and frontend projects

  • Property mode set to 100644
File size: 565 bytes
Line 
1import {Component, OnInit} from '@angular/core';
2import {CategoryService} from "../category.service";
3import {CategoryInterface} from "../categoryInterface";
4
5@Component({
6 selector: 'app-category',
7 templateUrl: './category.component.html',
8 styleUrls: ['./category.component.css']
9})
10export class CategoryComponent implements OnInit{
11
12 categories : CategoryInterface[] =[]
13
14 constructor(private categoryService: CategoryService) {
15 }
16
17 ngOnInit(): void {
18 this.categoryService.getAllCategories().subscribe(response => this.categories = response)
19 }
20
21}
Note: See TracBrowser for help on using the repository browser.