February 2017
Beginner to intermediate
294 pages
6h 9m
English
Now it is time to replace recent hardcoded values for the corpus with real functions, so open the evidence service and add the following modifications to it:
// src/app/evidence/evidence.service.ts //... @Injectable() export class EvidenceService { private corpusSize; private corpus: FirebaseListObservable <any>; private IDFs: FirebaseListObservable <any>; //... constructor(http: Http, af: AngularFire) { this.http = http; this.angularFire = af; this.corpus = af.database.list('Evidence/Corpus/Articles'); this.IDFs = af.database.list('Evidence/Corpus/IDFs'); } corpusBuilder(keywords) { // ToDo: // 1. Fetch links for each keyword // 2. Pass the link to EvidenceService for extracting contents // 3. Save them under corpus key for ...Read now
Unlock full access