pages + refactor

This commit is contained in:
2021-10-04 16:57:29 +02:00
parent 5004678f2b
commit c538200ea9
28 changed files with 439 additions and 91 deletions
+35
View File
@@ -0,0 +1,35 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { UserService } from '../../services/user.service';
@Component({
selector: 'page-user',
templateUrl: './user.page.html',
styleUrls: [ './user.page.scss' ]
})
export class PageUser implements OnInit {
notfound: boolean = false;
username: string;
user: any;
constructor(private userService: UserService,
private route: ActivatedRoute) { }
ngOnInit(): void {
this.username = this.route.snapshot.paramMap.get('username');
this.userService.getUser(this.username).subscribe((data) => {
this.user = data;
}, (error) => {
if (error.status == 404) {
this.notfound = true;
}
})
}
}