reformat code

This commit is contained in:
Manuel Hude
2021-05-02 10:54:38 +02:00
parent b703757621
commit b96a8d35c5
6 changed files with 28 additions and 24 deletions
@@ -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']);
});
}
}
+4 -4
View File
@@ -9,9 +9,9 @@ export interface WSEvents {
export interface Tweet {
icon: any
text: string
date_time: DateTimeFormat
url: String
icon: any;
text: string;
date_time: DateTimeFormat;
url: String;
}