The evidence component

As we know, the news link itself comes from items saved under the /Notifier/rated-news path. So let's pull out the news item with the highest rank from rated-news and pass it to the service for counting its words. To do so, open the component file and edit the contents as follows:

// src/app/evidence/evidence.component.ts import {Component} from '@angular/core'; import {EvidenceService} from "./evidence.service"; import {AngularFire} from "angularfire2"; @Component({ selector: 'sh-evidence', templateUrl: 'evidence.html' }) export class EvidenceComponent implements OnInit{ private angularFire; private evidenceService; constructor (es:EvidenceService, af: AngularFire) { this.evidenceService = es; this.angularFire = af; } ngOnInit() ...

Get Angular Services now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.