Skip to content

Commit

Permalink
Solution for lab #13
Browse files Browse the repository at this point in the history
  • Loading branch information
alcfeoh committed Jan 27, 2018
1 parent fd5221c commit f16a904
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 6 additions & 0 deletions solutions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,9 @@ Check solution at https://github.com/alcfeoh/ng2-training/releases/tag/lab11
File diff at https://github.com/alcfeoh/ng2-training/commit/11a85e29ceeaa169df27c9010fa1427819d3a4e3

----------------------------------------------------------------------------------
LAB#12

Check solution at https://github.com/alcfeoh/ng2-training/releases/tag/lab12
File diff at

----------------------------------------------------------------------------------
4 changes: 3 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export class AppComponent {
licensePlates: LicensePlate[];

constructor(private service: LicensePlateService) {
this.licensePlates = this.service.getList();
this.service.getList().subscribe( (data) => {
this.licensePlates = data;
});
}
}
7 changes: 4 additions & 3 deletions src/app/license-plate.service.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { Injectable } from '@angular/core';
import {LicensePlate} from './license-plate';
import {Observable} from 'rxjs';

@Injectable()
export class LicensePlateService {

constructor() { }

getList(): LicensePlate[] {
return [
getList(): Observable<LicensePlate[]> {
return Observable.of([
{
"_id": "5a0c8ab22d8dc1f7fa170c9d",
"onSale": false,
Expand Down Expand Up @@ -88,6 +89,6 @@ export class LicensePlateService {
"state": "PA",
"description": "Velit minim aute minim irure magna cupidatat est reprehenderit. Aliqua Lorem nostrud aliquip non voluptate qui fugiat. Amet pariatur proident cupidatat minim in laborum sit esse. Tempor eu eu elit cupidatat eu elit in aliqua eu culpa ut consequat culpa minim. Ut labore sit anim ea magna occaecat sunt laboris quis reprehenderit. Amet pariatur excepteur et ex et ex ad laboris aute nulla dolor ut nostrud.\r\n"
}
];
]);
}
}

0 comments on commit f16a904

Please sign in to comment.