February 2017
Beginner to intermediate
294 pages
6h 9m
English
To make the development clear and easy, let's create the service class with empty methods and implement them as we proceed.
Head to the /rating folder inside your source code and create a new class as follows:
// src/app/rating/rating.service.ts
import {Injectable} from "@angular/core";
@Injectable()
export class RatingService {
//ToDo: construct the service object
constructor() {}
//ToDo: get the collected news from Firebase db
getNews() {}
//ToDo: get the latest trends to show them inside the template
getTrends() {}
//ToDo: rate the news based on constructed rules
rateNews(){}
}
The first thing that we need to take care of is the business logic that we are going to use for rating. As we discussed before, the news date ...
Read now
Unlock full access