This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'bot-detail-header', | |
template: ` | |
<h2>{{bot?.description}}</h2> | |
<h5>Total completed Rescues: {{completedRescues?.length}}</h5> | |
<newsletter></newsletter> | |
`, | |
changeDetection: ChangeDetectionStrategy.OnPush | |
}) | |
export class BotDetailHeaderComponent { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<bot-detail-header | |
[bot]="bot$ | async" | |
[completedRescues]="completedRescues$ | async"> | |
</bot-detail-header> | |
<table class="table rescues-list"> | |
<tbody> | |
<tr *ngFor="let rescue of (completedRescues$ | async)">....</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'rescue-bot-detail', | |
templateUrl: './rescue-bot-detail.component.html' | |
}) | |
export class RescueBotDetailComponent implements OnInit { | |
bot$: Observable<Bot>; | |
completedRescues$: Observable<completedRescue[]>; | |
constructor( | |
private route: ActivatedRoute, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'bot-detail-header', | |
template: ` | |
<h2>{{bot?.description}}</h2> | |
<h5>Total completed Rescues: {{completedRescues?.length}}</h5> | |
<newsletter [firstName]="firstName" (subscribe)="onSubscribe($event)"></newsletter> | |
`, | |
changeDetection: ChangeDetectionStrategy.OnPush | |
}) | |
export class BotDetailHeaderComponent { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<bot-detail-header | |
[bot]="bot$ | async" | |
[completedRescues]="completedRescues$ | async" | |
[firstName]="(user$ | async).firstName" | |
(subscribe)="onSubscribe($event)"> | |
</bot-detail-header> | |
<table class="table rescues-list"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'rescue-bot-detail', | |
templateUrl: './rescue-bot-detail.component.html' | |
}) | |
export class RescueBotDetailComponent implements OnInit { | |
user$: Observable<User>; | |
bot$: Observable<Bot>; | |
completedRescues$: Observable<completedRescue[]>; | |
constructor( |