import {Component} from '@angular/core';
import {Item} from '../models/Item';
import {ItemsService} from '../services/itemsservice';

@Component({
  selector: 'items',
  templateUrl: './items.component.html',
  styleUrl: './items.component.scss',
  providers: [ItemsService]
})
export class ItemsComponent {

  items: Item[] = [];

  constructor(
    private itemsService: ItemsService
  ) {
  }

  async ngOnInit() {
    this.items = await this.itemsService.fetchItems();
  }
}
