Angular ngx fullpage-如何访问OnLeave内部的角度变量?

Angular ngx fullpage-如何访问OnLeave内部的角度变量?,angular,fullpage.js,Angular,Fullpage.js,我有这个 <div mnFullpage [mnFullpageOnLeave]="onLeave"> <div class="section welcome-section fp-section fp-table" *ngFor="let p of this.content.pages"> <div class="fp-tableCell"> <div class="page"> <div class="contentLaye

我有这个

<div mnFullpage [mnFullpageOnLeave]="onLeave">
 <div class="section welcome-section fp-section fp-table" *ngFor="let p of this.content.pages">
<div class="fp-tableCell">
  <div class="page">
    <div class="contentLayer">
      Content goes here
    </div>
  </div>
</div>

问题是…当我在onLeave中设置变量pageIndex时…这不是反映。有什么建议吗?

您是否添加了onLeave正常工作所需的参数?或者甚至在
mnFullpageOnLeave
上调用函数,你需要
onLeave(index,nextIndex,direction)
我不知道ngx fullpage,但你可能想使用官方的fullpage.js角度包装器:它是用最新的fullpage.js版本维护和更新的。是的,@Alvaro!这就是我昨天所做的…放弃了这个ngx完整的页面,现在我实际上正在使用你的官方角包装!干得好,伙计!很高兴它帮助了@MarcoJr!是否添加了onLeave正常工作所需的参数?或者甚至在
mnFullpageOnLeave
上调用函数,你需要
onLeave(index,nextIndex,direction)
我不知道ngx fullpage,但你可能想使用官方的fullpage.js角度包装器:它是用最新的fullpage.js版本维护和更新的。是的,@Alvaro!这就是我昨天所做的…放弃了这个ngx完整的页面,现在我实际上正在使用你的官方角包装!干得好,伙计!很高兴它帮助了@MarcoJr!
import { Component } from '@angular/core';
import { MnFullpageService } from 'ngx-fullpage';

@Component({
 selector: 'app-main-page',
 templateUrl: './mainPage.component.html',
 styleUrls: ['./mainPage.component.scss']
})
export class MainPageComponent {
readonly content = Content
pageIndex: number = 0;
constructor(public fullpageService: MnFullpageService) {

}
onLeave(index: number, nextIndex: object, direction: string): void {
   this.pageIndex = nextIndex.index;
}
}