0

What is best way to detect typos in HTML templates?

Example:

<h1>{{computer.systemTye}}</h1>

should be

<h1>{{computer.systemType}}</h1>

Ideally, I'd like to see the error in console during compilation. Or in debug console in browser.

I know I can write unit tests using TestBed class and use something like this

de = fixture.debugElement.query(By.css('h1'));
el = de.nativeElement;
Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
koral
  • 2,807
  • 3
  • 37
  • 65

1 Answers1

0

Use the default operator to show an error message. For example:

{{nae || 'error'}}

References

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265