Navigate to combobox selected item


#1

I have a combobox containing 3 options. Each option contains names of each page. So when I select one of the option and click the next button I need to move to the respective page. How can I do that?
pls help
here is my code:
html:

<ion-header>

    <ion-navbar>
        <ion-title>REGISTRATION</ion-title>
    </ion-navbar>
</ion-header>

<ion-content>
    <h1>Step 1 : Choose the category</h1>
    <ion-item>
        <ion-label>Category</ion-label>
        <ion-select [(ngModel)]="category">
            <ion-option value="i">Individual</ion-option>
            <ion-option value="t">3rd party</ion-option>
            <ion-option value="d">Dedicated</ion-option>
        </ion-select>
    </ion-item>

 
</ion-content>
<ion-footer no-shadow class="foot">
    <ion-toolbar position="bottom">
        <button (click)="rg()" ion-button full color="primary" block>Next</button>
    </ion-toolbar>
</ion-footer>

ts file:

import { Component } from '@angular/core';
import { NavController, AlertController, LoadingController, Loading, IonicPage } from 'ionic-angular';
import { ObsAuthService } from '../../services/obs_auth.services';
import { ConnectrgPage} from '../connectrg/connectrg';
import { IndividualregPage } from '../individualreg/individualreg';
import { NgModel } from '@angular/forms';
import { NgIf } from '@angular/common';

@Component({
    selector: 'page-connectreg',
    templateUrl: 'connectreg.html',
    providers: [ObsAuthService]
})
export class ConnectregPage {
    

    
    constructor(private nav: NavController, private auth: ObsAuthService,
        private alertCtrl: AlertController, private loadingCtrl: LoadingController) {}

        selectChange(e) {
            console.log(e);
        }
        
        public rg(){
            
            this.nav.push(IndividualregPage);
        }
    }

#2

Have you tried this code:

HTML

     <button (click)="rg(category)" ion-button full color="primary" block>Next</button>

TS

        public rg(cat){ 
            this.nav.push(cat);
        }

#3

@OliverPrimo Worked perfectly… Thanks …!!


#4

No problem. You can also mark my answer as the solution. Thanks :slight_smile: