18 lines
408 B
TypeScript
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});
|
|
}
|
|
|
|
}
|