|
|
@@ -1,4 +1,5 @@ |
|
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
import { Component, OnInit, ViewChild } from '@angular/core'; |
|
|
|
import { IonSlides } from '@ionic/angular'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'app-home', |
|
|
@@ -6,6 +7,8 @@ import { Component, OnInit } from '@angular/core'; |
|
|
|
styleUrls: ['./home.page.scss'], |
|
|
|
}) |
|
|
|
export class HomePage implements OnInit { |
|
|
|
@ViewChild('slides', {static: false}) slides: IonSlides; |
|
|
|
|
|
|
|
selectedTab: string = 'news'; |
|
|
|
selectedArticle: number = null; |
|
|
|
myComment: string = ''; |
|
|
@@ -82,7 +85,7 @@ export class HomePage implements OnInit { |
|
|
|
} |
|
|
|
|
|
|
|
expandArticle(index: number) { |
|
|
|
this.selectedArticle = index; |
|
|
|
this.selectedArticle = index; |
|
|
|
|
|
|
|
this.slideOpts = { |
|
|
|
slidesPerView: 1, |
|
|
@@ -90,6 +93,10 @@ export class HomePage implements OnInit { |
|
|
|
slidesOffsetBefore: 0, |
|
|
|
slidesOffsetAfter: 0, |
|
|
|
}; |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
this.slides.slideTo(index); |
|
|
|
}, 200); |
|
|
|
} |
|
|
|
|
|
|
|
closeArticle() { |
|
|
|