0

我有一个屏幕填满了代表不同扇区的不同框,所有扇区都有不同的子扇区。

我正在尝试单击其中一个部门,以便查看该特定部门的详细信息。

这些细节以幻灯片形式呈现。

对于每个部门,我都有一个ion-slide,在每张幻灯片中都有一个子部门列表。

我有以下代码可将我带到所选部门的幻灯片(从框中)。

它给了我这个错误:

Property 'parent' does not exist on type 'NavController'.

我尝试使用其他东西,但我找不到任何东西。请帮忙

@Component({
  selector: 'app-tile',
  templateUrl: './tile.component.html',
  styleUrls: ['./tile.component.scss'],
})
export class TileComponent implements OnInit {

  @Input() tileData: superSectorPassClass;
  @Input() superSectorIcon: string;

  constructor(private navCtrl: NavController, private events: Events, public globalVariableService: GlobalVariableServiceProvider) {

  }

  goToSlide(slideID: number) {
    this.globalVariableService.comesFromTileClick = true;
    console.log('this.globalVariableService.comesFromTileClick: ' + this.globalVariableService.comesFromTileClick);
    this.navCtrl.parent.select(1).then(() => {
      this.events.publish('go-to-slide', 1, slideID - 1);
      console.log('Published');
    });
  }

4

0 回答 0