Projekt

Obecné

Profil

Stáhnout (557 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1 5b862e59 Hung Hoang
import { Component, OnInit } from '@angular/core';
2
import { MenuService } from '../menu.service';
3
import { MenuItem } from './menuItem';
4
5
@Component({
6
  selector: 'app-menu',
7
  templateUrl: './menu.component.html',
8
  styleUrls: ['./menu.component.sass']
9
})
10
export class MenuComponent implements OnInit {
11
  menuItems: MenuItem[];
12
13
14
  getMenuItems(): void {
15
    this.menuService.getMenuItems()
16
      .subscribe(menuItems => this.menuItems = menuItems);
17
  }
18
19
  constructor(private menuService: MenuService) { }
20
21
  ngOnInit() {
22
    this.getMenuItems();
23
  }
24
25
26
}