How to open other page with condition..?

i have app.js below

app.controller(‘kategoriCtrl’, function($scope, dataService) {
$scope.listKat = [
{kat: ‘math’}, {kat: ‘physics’}, {kat: ‘English’}, {kat: ‘bahasa’},
]
$scope.showSelectValue = function(mySelect) {
console.log(mySelect);
}
})

and view Login as Page1.html
image
image

At the 1st step user are choosing category from select/combobox on page1.html. and submit to other form with condition when user chooses math and then open page page2.html else page3.html?

and i write dynamic variable on ui-sref to retreive value from select/combobox below.

How to write route in $stateProvider / .state to open other page, as illustration below?

if(selected=“math”){
varPage=“page2”;
} else
{ varPage=“page3”;}

.state(‘page’, {
url: “/page”,
templateUrl: ‘templates/’ + varPage + ‘.html’
})

you can use $state.go(‘index’); inside your conditional function

i facing problem retrieve value from select/combobox to deliver to under .config(function($stateProvider, $urlRouterProvider) {
}
?