Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49176

How to open other page with condition..?

$
0
0

@n0s13 wrote:

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

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

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49176

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>