|
@@ -1,5 +1,6 @@
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
-
|
|
|
+import { PopoverController } from '@ionic/angular';
|
|
|
+import { CommentModalPage } from 'src/app/comment-modal/comment-modal.page';
|
|
|
@Component({
|
|
|
selector: 'app-comments',
|
|
|
templateUrl: './comments.page.html',
|
|
@@ -7,22 +8,18 @@ import { Component, OnInit } from '@angular/core';
|
|
|
})
|
|
|
export class CommentsPage implements OnInit {
|
|
|
|
|
|
- constructor() { }
|
|
|
+ constructor(private popoverController: PopoverController) { }
|
|
|
|
|
|
- ngOnInit() {
|
|
|
+ async openCommentPopover(ev: any) {
|
|
|
+ const popover = await this.popoverController.create({
|
|
|
+ component: CommentModalPage,
|
|
|
+ event: ev,
|
|
|
+ translucent: true,
|
|
|
+ cssClass: 'comment-popover'
|
|
|
+ });
|
|
|
+ return await popover.present();
|
|
|
}
|
|
|
+ ngOnInit() { }
|
|
|
|
|
|
- isLiked: boolean = false;
|
|
|
- likeCount: number = 0;
|
|
|
-
|
|
|
- likeComment() {
|
|
|
- if (!this.isLiked) {
|
|
|
- this.likeCount++;
|
|
|
- this.isLiked = true;
|
|
|
- } else {
|
|
|
- this.likeCount--;
|
|
|
- this.isLiked = false;
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
-}
|
|
|
+}
|