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() { this.angularFire.database.list('/Notifier/rated-news', { query: { orderByChild: 'rank', limitToFirst: 1 // lets fetch 1 item for now }}).subscribe(data =>...