25 lines
540 B
TypeScript
25 lines
540 B
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { Beer } from './beer';
|
|
import { BeerService } from './beer.service';
|
|
|
|
@Component({
|
|
moduleId: module.id,
|
|
selector: 'my-dashboard',
|
|
templateUrl: './dashboard.component.html',
|
|
styleUrls: [ './dashboard.component.css' ]
|
|
})
|
|
|
|
export class DashboardComponent implements OnInit {
|
|
|
|
beers: Beer[] = [];
|
|
|
|
constructor(private beerService: BeerService) { }
|
|
|
|
ngOnInit(): void {
|
|
this.beerService
|
|
.getAll()
|
|
.subscribe(beers => this.beers = beers.slice(4, 8));
|
|
}
|
|
}
|