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
+39
View File
@@ -0,0 +1,39 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { CommentService } from '../../services/comment.service';
import { UiComments } from '../../ui/comments/comments.ui';
@Component({
selector: 'page-comment',
templateUrl: './comment.page.html',
styleUrls: [ './comment.page.scss' ]
})
export class PageComment implements OnInit {
id: number;
comment: any;
notfound: boolean = false;
constructor(private commentService: CommentService,
private route: ActivatedRoute) { }
ngOnInit(): void {
this.id = +this.route.snapshot.paramMap.get('id');
this.refresh();
}
refresh() {
this.commentService.getComment(this.id).subscribe((data) => {
this.comment = data;
}, (error) => {
if (error.status == 404) {
this.notfound = true;
}
})
}
}