concept html tag in category angular

appears as: HTML tags, HTML tag, n HTML tag
Getting MEAN with Mongo, Express, Angular, and Node.js 2ED

This is an excerpt from Manning's book Getting MEAN with Mongo, Express, Angular, and Node.js 2ED.

Pug is unusual compared with the other template engines, in that it doesn’t contain HTML tags in the templates. Instead, Pug takes a rather minimalist approach, using tag names, indentation, and a CSS-inspired reference method to define the structure of the HTML. The exception is the <div> tag. Because it’s so common, if the tag name is omitted from the template, Pug assumes that you want a <div>.

The secret is to use an Angular directive called *ngFor. When applied to a HTML tag and given an array of data, it loops through the array, creating an element for each entry. To access the value or properties of each item, you need to define a variable that Angular can use as it goes through the loop.

Adding the HTML tag to bind the Angular app

If you cast your mind back to earlier in the chapter or check the source code, you’ll remember that your app was bootstrapped into an HTML tag called app-home-list. All you want to do now is replace the list part of the homepage with your new holding tag.

Figure 9.14. The <br/> tags being inserted with your filter are being rendered as text rather than HTML tags.