Get your own Angular server
main.ts
index.html
 
import { bootstrapApplication } from '@angular/platform-browser';
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [CommonModule],
  template: `
    <h3>Conditional Rendering</h3>
    <button (click)="show = !show">Toggle</button>
    <p *ngIf="show; else hiddenTpl">Now you see me!</p>
    <ng-template #hiddenTpl>
      <p>Now I'm hidden.</p>
    </ng-template>
  `
})
export class App {
  show = true;
}

bootstrapApplication(App);

                    
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Angular Conditional Rendering</title>
</head>
<body>
  <app-root></app-root>
</body>
</html>