2017-03-18 2 views
0

내 페이지 내부 this plugin, 이온 슬라이드

내가 이온 슬라이드를 사용하고 있습니다와 이온 응용 프로그램의 사회적 공유를 구현하고 내부의 사회적 공유를

<ion-slides> 
    <ion-slide *ngFor="let item of strings"> 
     <div> 
     {{ item }} 
     </div> 
    </ion-slide> 
    </ion-slides> 

슬라이드

에 데이터를 얻을 내 타이프 스크립트 파일입니다 구현
export class Birthday { 
strings : Array<string>; 
    constructor(public navCtrl: NavController, public navParams: NavParams) { 
    this.strings = new Array<string>(); 
    this.strings.push('text1'); 
    this.strings.push('text2'); 
    this.strings.push('text3'); 
    this.strings.push('text4'); 

    } 
} 

현재 소셜 공유 플러그인을 사용하는 동안 메시지 입력란에서 현재 슬라이드 데이터를 가져 오는 방법

share(**slide data heree**, subject, file, link) { 
    this.platform.ready().then(() => { 
     if(window.plugins.socialsharing) { 
      window.plugins.socialsharing.share(message, subject, file, link); 
     } 
    }); 
} 

답변

1

구성 요소에서 슬라이드를 가져 오려면 viewChild를 사용하십시오.

import { Slides } from 'ionic-angular'; 

@ViewChild(Slides)slides:Slides 

//To get current slide, 
let index = this.slides.getActiveIndex(); 

//Get the item as: 
this.strings[index] 

문서 slides

에 대한