import { Observable } from "rxjs/Observable" ; import { Injectable } from "@angular/core" ; import { Response } from "@angular/http" ; import { JsonHttp } from "./" ; const url = '/api/microposts' ; @ Injectable ( ) export class MicropostService { constructor ( private http ) { } create ( content ) { return this . http . post ( url , { content : content } ) ; } delete ( id ) { return this . http . delete ( `${ url }/${ id }` ) ; } }