February 2017
Beginner to intermediate
294 pages
6h 9m
English
Now that we have all players in place, it is time to update our component to glue everything together. Open the component file and update it as follows:
// src/app/rating/rating.component.ts
import {Component} from '@angular/core';
import {RatingLogic} from './rating.logic';
import {RatingService} from './rating.service';
@Component({
selector: 'sh-rating',
templateUrl: './rating.html',
providers: [RatingLogic, RatingService]
})
export class RatingComponent {
private ratingService;
private trends;
private collectedNews;
private ratedNews;
constructor(rs:RatingService) {
this.ratingService = rs;
this.trends = rs.getTrends();
this.collectedNews = rs.getNews();
this.ratedNews= rs.rateNews();
}
}
Notice that we have specified ...
Read now
Unlock full access