Commit 88d8797e authored by Adarsh's avatar Adarsh

minor

parent 7a2260cb
# See http://help.github.com/ignore-files/ for more about ignoring files. # See http://help.github.com/ignore-files/ for more about ignoring files.
/users /users
.vscode
# compiled output # compiled output
/dist /dist
/tmp /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)) { ...@@ -19,7 +19,5 @@ if (isset($postData) && !empty($postData)) {
else { else {
http_response_code(404); http_response_code(404);
} }
} }
?> ?>
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {ProblemService} from '../problem.service'; import {ProblemService} from '../problem.service';
import { ApiService } from '../api.service';
import {Problem} from '../problem'; import {Problem} from '../problem';
import { User } from '../user';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
...@@ -9,12 +11,17 @@ import {Problem} from '../problem'; ...@@ -9,12 +11,17 @@ import {Problem} from '../problem';
}) })
export class HomeComponent implements OnInit { export class HomeComponent implements OnInit {
user: User;
loggedIn: boolean;
problems: Problem[]; problems: Problem[];
constructor(private problemService: ProblemService) { constructor(private dataService: ApiService,
private problemService: ProblemService) {
} }
ngOnInit(): void { ngOnInit(): void {
this.user = JSON.parse(this.dataService.getToken());
console.log(this.user);
this.getProblems(); this.getProblems();
} }
......
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {Problem} from './problem'; import {Problem} from './problem';
import {Observable, of} from 'rxjs'; import {Observable, of} from 'rxjs';
import {User} from './user';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
......
import {Problem} from './problem';
export interface User { export interface User {
id: number;
username: string; username: string;
name: string; name: string;
password: string; password: string;
email: string; email: string;
img_url: string; img_url: string;
n_attempts: number; n_attempts: number;
n_files: number;
correct_timeline: string; correct_timeline: string;
rating: number; 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