Skip to content

Commit

Permalink
Solution for lab #14
Browse files Browse the repository at this point in the history
  • Loading branch information
alcfeoh committed Jan 29, 2018
1 parent c70b38d commit 63fd79d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<div class="container">
<div class="row" >
<app-license-plate *ngFor="let plate of licensePlates" appHighlight
<app-license-plate *ngFor="let plate of licensePlates | async" appHighlight
[plate]="plate" buttonText="Add to cart" class="col-md-4">

</app-license-plate>
Expand Down
7 changes: 3 additions & 4 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import { Component } from '@angular/core';
import {LicensePlate} from './license-plate';
import {LicensePlateService} from './license-plate.service';
import {Observable} from 'rxjs';

@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {

licensePlates: LicensePlate[];
licensePlates: Observable<LicensePlate[]>;

constructor(private service: LicensePlateService) {
this.service.getList().subscribe( (data) => {
this.licensePlates = data;
});
this.licensePlates = this.service.getList();
}
}

0 comments on commit 63fd79d

Please sign in to comment.