Add stock data api call
This commit is contained in:
@@ -12,21 +12,27 @@ export class DataService {
|
||||
private tokenStorage: TokenStorageService
|
||||
) {}
|
||||
|
||||
httpOptions = {
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
};
|
||||
headers = new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
});
|
||||
|
||||
getStockData(): Observable<any> {
|
||||
return this.http.get(API_URL + 'portfolio', {
|
||||
headers: this.httpOptions.headers,
|
||||
async getStockData() {
|
||||
await this.http
|
||||
.get(API_URL + 'portfolio', {
|
||||
headers: this.headers,
|
||||
responseType: 'text',
|
||||
})
|
||||
.subscribe((data) => {
|
||||
console.log(data);
|
||||
return data;
|
||||
});
|
||||
}
|
||||
|
||||
getKeywords(): Observable<any> {
|
||||
return this.http.get(API_URL + 'keywords', {
|
||||
headers: this.headers,
|
||||
responseType: 'text',
|
||||
});
|
||||
}
|
||||
|
||||
showStorage() {
|
||||
console.log(localStorage);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user