In this lesson, you'll continue the process of sharing data from the parent component to the child component by binding data to those properties in the template using property binding.
Property binding enables you to connect a variable to an Input in an Angular template. The data is then dynamically bound to the Input.
For a more in depth explanation, please refer to the Property binding guide.
When adding a property binding to a component tag, we use the [attribute] = "value" syntax to notify Angular that the assigned value should be treated as a property from the component class and not a string value.
The value on the right-hand side is the name of the property from the HomeComponent.
Conceptual preview of Inputs
In this lesson, you'll continue the process of sharing data from the parent component to the child component by binding data to those properties in the template using property binding.
Property binding enables you to connect a variable to an Input in an Angular template. The data is then dynamically bound to the Input.
For a more in depth explanation, please refer to the Property binding guide.
1. Update the HomeComponent template
This step adds property binding to the tag. In the code editor:
Add housingLocation property binding
When adding a property binding to a component tag, we use the [attribute] = "value" syntax to notify Angular that the assigned value should be treated as a property from the component class and not a string value.
The value on the right-hand side is the name of the property from the HomeComponent.
2. Confirm the code still works