- Structural directives shape the page by adding and removing elements.
- Structural directives start with a *, such as
*ngIf
,*ngFor
. *ngIf
adds or removes the host element and it's descendants.- Each iteration of
*ngFor
creates a copy of the host element and it's descendants.
- Structural directives start with a *, such as
- How to handle an event with a
(eventName)
directive and then execute a simple statement or function call.(click)
,(keyup)
,(mouseover)
, etc.
- How to use template reference variables and a click handler to take in user input - Example:
<input #name (click)="addThing(name)">
.
- Check with your class Candidate Engagement Manager for any other announcements.
- Graded assignment #6 is due soon after class 20.
- Provide an introduction to what students can expect in unit 2.
- Welcome to Day 29!
- Work through Lesson 29.
- Assignment 5 due at end of Day.
- Q & A as needed for the prep-work exercises.
- Discuss the relative scale/priority for the different Angular directives - components, structural directives, attribute directives.
- Remind the students that only one structural directive can be placed inside an HTML tag. With this in mind, ask how we would approach a situation where we want to use two of these directives?
- Live code examples for
*ngFor
and*ngIf
.- Discuss the difference between hiding HTML elements vs. removing them.
- If time permits, discuss commonly used events besides the
keyup
,keydown
,click
, andmouseover
presented in the reading. - Studio intro.
- Remember to do the prep work if you are struggling with Angular yourself! Be the coach your students need.
- Students need to fork
mission-planner
repository. Students will work on thestudio-2
branch. No fair peeking at thestudio-2-solutions
branch first! - Remind the students to run
npm install
before trying to serve the project. - The instructions do NOT guide the students on how to make the rocket name editable. Instead, the students must examine the code for the mission name, then apply that to the rocket. Be ready to help your students with the process of adapting similar code to solve a different problem.
- In addition to the bonus missions, encourage your students to play with the CSS to make the webpage look a little less bland.