0

I have a screen filled up with different boxes that represent different sectors, all sectors have different sub sectors.

I am trying to click on one of the sectors so that I can go to that particular sector's details.

These details are presented in slides.

For each sector i have an ion-slide, in each slide there is a list of the sub sectors.

I have the below code to take me to the chosen sector's slide(from box).

It is giving me this error:

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

I tried using something else but I couldn't find anything. PLEASE HELP

@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');
    });
  }

rtpHarry
  • 13,019
  • 4
  • 43
  • 64
Joanne Fsadni
  • 103
  • 1
  • 8
  • To be honest, this seems like you have missed some vital concepts with how Ionic and Angular work. The `globalVaraibleService` is a warning sign. Do you have the entire codebase online somewhere like a github repo? – rtpHarry Aug 29 '19 at 13:12
  • The global variable service is a provider i created to get the language through out the app. Tbh i dont think that thats the problem. And no i dont have the code online. – Joanne Fsadni Aug 30 '19 at 06:18

0 Answers0