import { Observable } from "rxjs/Observable" ; import { Injectable } from "@angular/core" ; import { Response } from "@angular/http" ; import { JsonHttp } from "../../core/services" ; const url = '/api/relationships' ; @ Injectable ( ) export class FollowBtnService { constructor ( private http ) { } follow ( followerId ) { return this . http . post ( `${ url }/to/${ followerId }` , { } ) ; } unfollow ( followerId ) { return this . http . delete ( `${ url }/to/${ followerId }` ) ; } }