Using pipe in combination with *ngIf and Observables

Using pipe in combination with *ngIf and Observables

Attempting to show a template until the posts Observable is ready:

Attempting to show a template until the posts Observable is ready:

    <ng-template #loading>
        <div>Loading...</div>
    </ng-template>

&lt;div *ngIf="posts | async else loading"&gt;
{{ posts | json }}
&lt;/div&gt;  

When the posts Observable is set, the posts | json renders like this:

    { "_isScalar": false, "source": { "_isScalar": true, "value": [ { "title": "Simulating HTTP Requsts", "content": "This is off the hook!!" } ] }, "operator": { "delay": 3000, "scheduler": { "actions": [], "active": false } } }

How do we get it to render just the value that we would normally get via posts | async?

I tried posts | async | json but that renders null first and then 3 seconds later it renders the value.

This is the stackblitz.

javascript typescript reactjs

What's new in Bootstrap 5 and when Bootstrap 5 release date?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Random Password Generator Online

HTML Color Picker online | HEX Color Picker | RGB Color Picker

TypeScript interface signature for the onClick event in ReactJS

The official&nbsp;<a href="https://reactjs.org/tutorial/tutorial.html" target="_blank">reactjs.org</a>&nbsp;website contains an excellent introductory tutorial.

TypeScript VS Flow: Type Checking Front End JavaScript

TypeScript VS Flow: Syntax, IDE support, framework support, and roadmaps.

The essential JavaScript concepts that you should understand

The essential JavaScript concepts that you should understand - For successful developing and to pass a work interview