reformat code
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {AuthService} from '../../services/auth.service';
|
||||
import {HttpClient, HttpHeaders} from '@angular/common/http';
|
||||
|
||||
@@ -13,29 +13,32 @@ class Tweet {
|
||||
})
|
||||
export class TweetsComponent implements OnInit {
|
||||
|
||||
tweets:Tweet[] = [];
|
||||
tweets: Tweet[] = [];
|
||||
|
||||
constructor(private http: HttpClient,
|
||||
private authService: AuthService) { }
|
||||
private authService: AuthService) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
loadMore() {
|
||||
|
||||
const headerDict = {
|
||||
'Authorization': 'Bearer ' + this.authService.getToken(),
|
||||
};
|
||||
|
||||
|
||||
|
||||
return this.http.get('http://localhost:8000/api/login',
|
||||
{
|
||||
headers: new HttpHeaders(headerDict),
|
||||
observe: 'response',
|
||||
})
|
||||
.subscribe(data => { console.log(data); alert('Returned with code: ' + data['status']); });
|
||||
}
|
||||
const headerDict = {
|
||||
'Authorization': 'Bearer ' + this.authService.getToken(),
|
||||
};
|
||||
|
||||
|
||||
return this.http.get('http://localhost:8000/api/login',
|
||||
{
|
||||
headers: new HttpHeaders(headerDict),
|
||||
observe: 'response',
|
||||
})
|
||||
.subscribe(data => {
|
||||
console.log(data);
|
||||
alert('Returned with code: ' + data['status']);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user