import { Injectable } from '@angular/core' ; import { Headers , Http } from '@angular/http' ; import 'rxjs/add/operator/toPromise' ; @ Injectable ( ) export class LoginService { private headers = new Headers ( { 'Content-Type' : 'application/json' } ) ; private loginUrl = 'api/login' ; constructor ( private http ) { } doLogin ( ) { return Promise . resolve ( true ) ; } verifyToken ( ) { return true ; } private handleError ( error ) { console . error ( 'An error occurred' , error ) ; return Promise . reject ( error . message || error ) ; } }