Commit 88d8797e authored by Adarsh's avatar Adarsh

minor

parent 7a2260cb
# See http://help.github.com/ignore-files/ for more about ignoring files.
/users
.vscode
# compiled output
/dist
/tmp
......
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
\ No newline at end of file
......@@ -19,7 +19,5 @@ if (isset($postData) && !empty($postData)) {
else {
http_response_code(404);
}
}
?>
import {Component, OnInit} from '@angular/core';
import {ProblemService} from '../problem.service';
import { ApiService } from '../api.service';
import {Problem} from '../problem';
import { User } from '../user';
@Component({
selector: 'app-home',
......@@ -9,12 +11,17 @@ import {Problem} from '../problem';
})
export class HomeComponent implements OnInit {
user: User;
loggedIn: boolean;
problems: Problem[];
constructor(private problemService: ProblemService) {
constructor(private dataService: ApiService,
private problemService: ProblemService) {
}
ngOnInit(): void {
this.user = JSON.parse(this.dataService.getToken());
console.log(this.user);
this.getProblems();
}
......
import {Injectable} from '@angular/core';
import {Problem} from './problem';
import {Observable, of} from 'rxjs';
import {User} from './user';
@Injectable({
providedIn: 'root'
......
import {Problem} from './problem';
export interface User {
id: number;
username: string;
name: string;
password: string;
email: string;
img_url: string;
n_attempts: number;
n_files: number;
correct_timeline: string;
rating: number;
my_questions: Problem[];
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment