Files
bookstore-angular/store-front/src/app/services/book.service.ts
Le Deng fbd32b347a latest
2017-03-09 17:33:39 -05:00

18 lines
408 B
TypeScript

import { Injectable } from '@angular/core';
import {Headers, Http} from "@angular/http";
@Injectable()
export class BookService {
constructor(private http: Http) { }
getBookList() {
let url = "http://localhost:8181/book/bookList";
let tokenHeader = new Headers ({
'x-auth-token' : localStorage.getItem("xAuthToken")
});
return this.http.get(url, {headers : tokenHeader});
}
}