Probably, you have already observed that earlier, when we listed all the companies, we created some nice URLs. We are going to use that path to display all the details of a company together with the available jobs.
The URL also contains the company slug, which is a URL-friendly representation of the company name. It has no benefit for the user, it's just URL sugar we added to display the name of the company nicely. Only the company ID is used when querying the backend for data.
As we have all the necessary components and services, we can implement our details component by following these steps:
Create a new file, called
public/src/company/components/company-detail.component.ts
.Add the necessary dependencies:
import { Component, OnInit } from 'angular2/core'; import { RouteParams, RouterLink } from 'angular2/router'; import { CompanyService } from '../company.service'; import { Company } from '../company.model'; import { JobsComponent } from '../../job/index';
Append the
Component...