diff options
| 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 |
| commit | 807e72b990e7412bdf243095a07bd716bb93453f (patch) | |
| tree | 3d89861fb5bab4fcf11872a2b262bb192948a32a /src/app/components/comment/comment.component.ts | |
| parent | 94d421d08f24b117b58bc87799861016fbff8ec0 (diff) | |
| download | DevHive-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.ts | 12 |
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 { |
