We are going to close our chapter with the bid
module, as we used many of its components in the previous auction
module. Only the bid listing
will be discussed, as it implies working with the underlining socket stream.
From the previous AuctionDetailComponent
, we can see that this component will have the bids as input. This data comes from the auction
entity, which holds previously placed bids.
Create a new file called public/src/bid/components/bid-list.component.ts
:
import { Component, OnInit, OnDestroy } from 'angular2/core'; import { BidService } from '../bid.service'; import { Bid } from '../bid.model'; import { BidComponent } from './bid.component'; @Component({ selector: 'bid-list', inputs: ['bids'], directives: [BidComponent], template: ` <div class="bid-list"> <div *ngIf="bids.length === 0" class="empty-bid-list"> <h3>No bids so far :)</h3> </div> <bid *ngFor="#bid of...