Take It for a Ride

We need to create two HTML files, one that is referenced by the component’s templateUrl attribute and the other, which will load up Angular and get things in motion.

Let’s edit the public/tasks.component.html file first.

​ <body>
​  <div class=​"heading"​>TO-DO</div>
​ 
​  <div id=​"taskslist"​>
​  <p>Number of tasks: <span id=​"length"​>{{ tasks.length }}</span>
​  <span id=​"message"​>{{ message }}</span>
​  <table>
​  <tr ​*​ngFor =​"let task of tasks"​>
​  <td>{{ task.name }}</td>
​  <td>{{ task.month }}/{{ task.day }}/{{ task.year }}</td>
​  </table>
​  </div>
​ </body>

The file displays the number of tasks using the expression that binds to the component’s tasks ...

Get Test-Driving JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.