如何将值发送到Ionic中具有条件的其他页面
My app.js
below:
我的app.js如下:
var app = angular.module('dbpjkApps', ['ionic'])
app.controller('kategoriCtrl', function($scope) {
$scope.listKat = [
{kat: 'math'}, {kat: 'physics'}, {kat: 'English'}, {kat: 'bahasa'},
]})
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('menu1', {
url: '/menu1',
templateUrl: 'xxx.html' //this is condition what i mean.
})
.state('login1', {
url: '/login1',
templateUrl: 'login1.html'
});
$urlRouterProvider.otherwise('/login1');
})
})
At the 1st step user are choosing category from select/combobox
on login1.html
.
在第一步,用户从login1.html上的select / combobox中选择类别。
How to write condition when user chooses math or physics, and then open page menu1.html
or menu2.html
accordingly? And how to get value that user chooses from login1.html
on menu1.html
or menu2.html
?
当用户选择数学或物理时,如何写条件,然后打开页面menu1.html或menu2.html?如何从menu1.html或menu2.html上的login1.html中获取用户选择的价值?
Thank You :)
谢谢 :)
2 个解决方案
#1
0
You can use the ng-model on combobox which will give you selected value
您可以在组合框上使用ng-model,它将为您提供所选值
and just define the state in stateProvider
并只在stateProvider中定义状态
.state('menu1', {
url: '/menu1',
templateUrl: 'menu1.html' //this is condition what i mean.
})
.state('menu2', {
url: '/menu2',
templateUrl: 'menu2.html' //this is condition what i mean.
})
After that just check the ng-model value of combobox in Login Controller after that just add following line to redirect the page
之后只需在登录控制器中检查组合框的ng-model值,然后只需添加以下行即可重定向页面
if(condition1){
$state.go('menu1');
}else if(condition2){
$state.go('menu2');
}
更多相关文章
- java漏洞成黑客目标微软呼吁用户更新软件
- JSP页面中有一个按钮 点击之后执行JAVA文件
- 有没有做过java的jsp页面调用海康视频的sdk二次开发……
- 处理“您确定您想要离开这个页面”Msg在Selenium 2.0。
- 用户的身份证号和手机号验证
- Javascript实现页面加载完成后自动刷新一遍清除缓存文件
- JAVAWEB网站开发,一对多,多对一,主表与子表(主外键)相连接,会导致主表
- Ldap 修改用户密码及安装证书
- vue、react等单页面项目部署到服务器的方法及vue和react的区别