Skip to content

task#01 auction list component

bacn edited this page Sep 16, 2020 · 1 revision

Build an AuctionList component

  1. Create a AuctionList component with ng(-cli)
  2. Use the new component in the AppComponent view

Result

Compile and start the application with

ng serve

Open project in browser

  • Open your browser with the address http://localhost:4200/
  • In the browser window shall appear:
    app works!
    auction-list works!

Hints

  • ng generate component auction-list
  • in file app.component.html add <app-auction-list></app-auction-list>
  • Delete the auto generated content from app.component.html and replace it with <p>app works!</p>

ng generate

The ng generate command shows the generated files:

ng generate component auction-list
CREATE src/app/auction-list/auction-list.component.scss (0 bytes)
CREATE src/app/auction-list/auction-list.component.html (27 bytes)
CREATE src/app/auction-list/auction-list.component.spec.ts (664 bytes)
CREATE src/app/auction-list/auction-list.component.ts (299 bytes)
UPDATE src/app/app.module.ts (497 bytes)

Content of the file app.component.html

<p>app works!</p>
<app-auction-list></app-auction-list>

Clone this wiki locally