Implementing a routed page

Having the routes setup in place, implement the product details page component by following these steps:

  1. Generate ProductDetailsComponent with the following command:
ng generate component modules/market/product-details
  1. Replace its HTML file content with the following:
<div>  <img [src]="primaryImageSrc" />  <h3>{{product.title}}</h3>  <span>{{product.description}}</span></div>
  1. Replace its CSS file content with the following:
img {  max-width: 80px;  max-height: 80px;}
  1. Set the class to receive a product as input with a primaryImageSrc getter:
import { Component, Input } from '@angular/core';import { Product } from '../../../model'; @Component({  selector: 'app-product-details', templateUrl: './product-details.component.html', ...

Get Hands-On Full-Stack Web Development with ASP.NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.