update dependencies, migrate subscribe, add submit type to buttons
This commit is contained in:
@@ -7,14 +7,14 @@ import { CommentService } from '../../services/comment.service';
|
||||
@Component({
|
||||
selector: 'page-comment',
|
||||
templateUrl: './comment.page.html',
|
||||
styleUrls: [ './comment.page.scss' ]
|
||||
styleUrls: ['./comment.page.scss']
|
||||
})
|
||||
export class PageComment implements OnInit {
|
||||
|
||||
id: number;
|
||||
comment: any;
|
||||
notfound: boolean = false;
|
||||
ignoreSubcomments: string[] = [ 'entry' ];
|
||||
ignoreSubcomments: string[] = ['entry'];
|
||||
|
||||
constructor(private commentService: CommentService,
|
||||
private route: ActivatedRoute) { }
|
||||
@@ -22,11 +22,14 @@ export class PageComment implements OnInit {
|
||||
ngOnInit(): void {
|
||||
this.id = +this.route.snapshot.paramMap.get('id');
|
||||
|
||||
this.commentService.getComment(this.id).subscribe((data) => {
|
||||
this.comment = data;
|
||||
}, (error) => {
|
||||
if (error.status == 404) {
|
||||
this.notfound = true;
|
||||
this.commentService.getComment(this.id).subscribe({
|
||||
next: (data) => {
|
||||
this.comment = data;
|
||||
},
|
||||
error: (error) => {
|
||||
if (error.status == 404) {
|
||||
this.notfound = true;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user