Exercise Goals

Output facts about Chuck Norris rendering the html value as the innerHTML of an element.

Tasks

  1. Open the app.component.html template file and create a new <p> element.
  2. Iterate over the facts property that are defined in the AppComponent class using the NgFor structural directive, binding the innerHTML propert of the paragraph element to the html property of each fact.

Exercise

Exercise Problem

Notes

  • The array of Fact objects are defined in the AppComponent class. Each Fact object has a single html property that is required by the Fact interface.
  • Use the square-bracket notation to bind the value of the innerHTML property on each <p> element to the expression, which is the html property on each fact template input variable that is unique within each iteration of the NgFor directive.