aboutsummaryrefslogtreecommitdiff
path: root/src/app/components/comment/comment.component.ts
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-03-14 08:34:59 +0200
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-03-14 08:34:59 +0200
commit807e72b990e7412bdf243095a07bd716bb93453f (patch)
tree3d89861fb5bab4fcf11872a2b262bb192948a32a /src/app/components/comment/comment.component.ts
parent94d421d08f24b117b58bc87799861016fbff8ec0 (diff)
downloadDevHive-Angular-807e72b990e7412bdf243095a07bd716bb93453f.tar
DevHive-Angular-807e72b990e7412bdf243095a07bd716bb93453f.tar.gz
DevHive-Angular-807e72b990e7412bdf243095a07bd716bb93453f.zip
Updated comment and comment-page's subscriptions to use an observer object
Diffstat (limited to 'src/app/components/comment/comment.component.ts')
-rw-r--r--src/app/components/comment/comment.component.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/app/components/comment/comment.component.ts b/src/app/components/comment/comment.component.ts
index 5076769..d4dd9f4 100644
--- a/src/app/components/comment/comment.component.ts
+++ b/src/app/components/comment/comment.component.ts
@@ -25,23 +25,23 @@ export class CommentComponent implements OnInit {
this.comment = this._commentService.getDefaultComment();
this.user = this._userService.getDefaultUser();
- this._commentService.getCommentRequest(Guid.parse(this.paramId)).subscribe(
- (result: object) => {
+ this._commentService.getCommentRequest(Guid.parse(this.paramId)).subscribe({
+ next: (result: object) => {
Object.assign(this.comment, result);
this.timeCreated = new Date(this.comment.timeCreated).toLocaleString('en-GB');
this.loadUser();
}
- );
+ });
}
private loadUser(): void {
- this._userService.getUserByUsernameRequest(this.comment.issuerUsername).subscribe(
- (result: object) => {
+ this._userService.getUserByUsernameRequest(this.comment.issuerUsername).subscribe({
+ next: (result: object) => {
Object.assign(this.user, result);
this.loaded = true;
}
- );
+ });
}
goToAuthorProfile(): void {