Skip to content

Commit

Permalink
Solution for lab #4
Browse files Browse the repository at this point in the history
  • Loading branch information
alcfeoh committed Jan 17, 2018
1 parent cb30246 commit 5280275
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 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" >
<!-- License plates go here -->
<app-license-plate [plate]="licensePlate" buttonText="Add to cart" class="col-md-4"></app-license-plate>
</div>
</div>
</main>
Expand Down
4 changes: 2 additions & 2 deletions src/app/license-plate/license-plate.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ <h2>{{plate.title}}</h2>
<img src="{{plate.picture}}" class="img-fluid" >
<p>{{plate.description}}</p>
<div>
<h2 class="float-left">$xx</h2>
<button class="btn btn-primary float-right" role="button">
<h2 class="float-left">${{plate.price}}</h2>
<button class="btn btn-primary float-right" role="button" (click)="alert('Plate added to cart')">
{{buttonText}}
</button>
</div>
4 changes: 4 additions & 0 deletions src/app/license-plate/license-plate.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ export class LicensePlateComponent {
buttonText: string;

constructor() { }

alert(message: string): void {
alert(message);
}
}

0 comments on commit 5280275

Please sign in to comment.