Added API and first UI
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user