Closed JorisSchelfaut closed 3 months ago
NOTE: In the YouTube video, the lecturer suggests using --inline-template
to not create the template as a separate HTML file;, but instead use the inline notation:
template: `
...some html...
`
as well as the --standalone
flag
YouTube : Components in Angular - Learning Angular (Part 3)
1. Create the HousingLocationComponent
In this step, you create a new component for your app. In the Terminal pane of your IDE:
first-app
directory.HousingLocationComponent
Note: This step is only for your local environment!
http://localhost:4200
to find the application.ng serve
running as you complete the next steps.2. Add the new component to your app's layout
In this step, you add the new component, HousingLocationComponent to your app's HomeComponent, so that it displays in your app's layout. In the Edit pane of your IDE:
home.component.ts
in the editor.home.component.ts
, importHousingLocationComponent
by adding this line to the file level imports.@Component
metadata by addingHousingLocationComponent
to the array.3. Add the styles for the component
In this step, you will copy over the pre-written styles for the HousingLocationComponent to your app so that the app renders properly.