Created
August 28, 2019 17:52
-
-
Save alexzuza/b641076a2cb9b7ab09b2f33dbd242dd5 to your computer and use it in GitHub Desktop.
Products html
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
<h2 class="title">Products</h2> | |
<div class="search-bar"> | |
<input (input)="searchStream$.next($event.target.value)"> | |
</div> | |
<div class="results"> | |
<h3>Built-in solution</h3> | |
<div *ngIf="obs$ | async as obs"> | |
<ng-template [ngIf]="obs.type === 'finish'"> | |
{{obs.value}} | |
</ng-template> | |
<ng-template [ngIf]="obs.type === 'start'">Loading...</ng-template> | |
</div> | |
<h3>WithLoadingPipe</h3> | |
<div *ngIf="obs$ | withLoading | async as obs"> | |
<ng-template [ngIf]="obs.value">{{ obs.value }} | |
</ng-template> | |
<ng-template [ngIf]="obs.loading">Loading...</ng-template> | |
</div> | |
</div> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment