adev/src/content/tutorials/first-app/steps/03-HousingLocation/README.md
This tutorial lesson demonstrates how to add the HousingLocation component to your Angular app.
HousingLocation and it displays a message confirming that the component was added to your application.In the Terminal pane of your IDE:
In your project directory, navigate to the first-app directory.
Run this command to create a new HousingLocation
ng generate component housingLocation
Run this command to build and serve your app.
ng serve
NOTE: This step is only for your local environment!
Open a browser and navigate to http://localhost:4200 to find the application.
Confirm that the app builds without error.
HELPFUL: It should render the same as it did in the previous lesson because even though you added a new component, you haven't included it in any of the app's templates, yet.
Leave ng serve running as you complete the next steps.
</docs-step>
In the Edit pane of your IDE:
Open home.ts in the editor.
In home.ts, import HousingLocation by adding this line to the file level imports.
Next update the imports property of the @Component metadata by adding HousingLocation to the array.
Now the component is ready for use in the template for the Home. Update the template property of the @Component metadata to include a reference to the <app-housing-location> tag.
Open src/app/housing-location/housing-location.css, and paste the styles below into the file:
NOTE: In the browser, these can go in src/app/housing-location/housing-location.ts in the styles array.
Save your code, return to the browser and confirm that the app builds without error. You should find the message "housing-location works!" rendered to the screen.Correct any errors before you continue to the next step.
SUMMARY: In this lesson, you created a new component for your app and added it to the app's layout.