Initial implementation of login and registration with fake backend for future testing
Also introduced flex-layout
This commit is contained in:
29
src/app/test/test.component.ts
Normal file
29
src/app/test/test.component.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import {SocketService} from '../socket/socket.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-test',
|
||||
templateUrl: './test.component.html',
|
||||
styleUrls: ['./test.component.css']
|
||||
})
|
||||
export class TestComponent implements OnInit {
|
||||
|
||||
onClickSocket() {
|
||||
this.socketService.send('test', {'user': 'USERNAME', 'payload': 'PAYLOAD TEST'})
|
||||
}
|
||||
|
||||
onClickApi() {
|
||||
this.httpService.get('http://localhost:5005/').subscribe(response => {
|
||||
console.log('REST API call returned: ', response);
|
||||
});
|
||||
}
|
||||
|
||||
constructor(private httpService: HttpClient,
|
||||
private socketService: SocketService,
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user