Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To display a blank page without any error messages in Angular 8, you can follow these steps:

  1. Create a new component or use an existing one.
  2. In the component.ts file, remove all the code inside the class and the constructor function.
  3. In the component.html file, remove all the code inside the HTML tags, including the tags themselves.
  4. Save the changes and run the application. You should now see a blank page with no error messages.

Alternatively, you can create a new component and set its template to an empty string. Here's an example:

  1. Generate a new component using the Angular CLI command ng generate component blank-page.
  2. Open the blank-page.component.ts file and update the template property to an empty string as follows:
import { Component } from '@angular/core';

@Component({
  selector: 'app-blank-page',
  template: ''
})
export class BlankPageComponent { }
  1. Save the changes and run the application. The BlankPageComponent will be displayed with no content, resulting in a blank page with no error messages.