update dependencies, migrate subscribe, add submit type to buttons
This commit is contained in:
@@ -4,7 +4,7 @@ import { CommentService } from '../../services/comment.service';
|
||||
@Component({
|
||||
selector: 'ui-commentcount',
|
||||
templateUrl: './commentcount.ui.html',
|
||||
styleUrls: [ './commentcount.ui.scss' ]
|
||||
styleUrls: ['./commentcount.ui.scss']
|
||||
})
|
||||
export class UiCommentCount implements OnInit {
|
||||
|
||||
@@ -16,12 +16,16 @@ export class UiCommentCount implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.target && this.parent) {
|
||||
this.commentService.countParent(this.target, this.parent).subscribe((data) => {
|
||||
this.count = +data;
|
||||
this.commentService.countParent(this.target, this.parent).subscribe({
|
||||
next: (data) => {
|
||||
this.count = +data;
|
||||
}
|
||||
});
|
||||
} else if (this.target) {
|
||||
this.commentService.count(this.target).subscribe((data) => {
|
||||
this.count = +data;
|
||||
this.commentService.count(this.target).subscribe({
|
||||
next: (data) => {
|
||||
this.count = +data;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user