Website Summary Files Commits Branches @commit @diff @stats
path: root / src / app / components / comment / comment.component.ts
diff options
context:
space:
mode:
Commit807e72b990e7412bdf243095a07bd716bb93453f (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-03-14 08:34:59 +0200
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-03-14 08:34:59 +0200
Files3d89861fb5bab4fcf11872a2b262bb192948a32a /src/app/components/comment/comment.component.ts
DevHive-Angular-807e72b990e7412bdf243095a07bd716bb93453f.tar
DevHive-Angular-807e72b990e7412bdf243095a07bd716bb93453f.tar.gz
DevHive-Angular-807e72b990e7412bdf243095a07bd716bb93453f.zip
Parent94d421d08f24b117b58bc87799861016fbff8ec0 (diff)
Updated comment and comment-page's subscriptions to use an observer object
1 files changed, 6 insertions, 6 deletions
-rw-r--r--src/app/components/comment/comment.component.ts12
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 {