加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs1.x radio组checkbox组

发布时间:2020-12-17 07:02:54 所属栏目:安全 来源:网络整理
导读:check组只要判断是否为true就可以 span style=‘display:block;float:left;padding:7px;‘input type=‘checkbox‘ ng-model="formDataObject.week.monday" style=‘vertical-align:-2px;‘ /星期一/spanspan style=‘display:block;float:left;padding:7px;

check组只要判断是否为true就可以

<span style=‘display:block;float:left;padding:7px;‘><input type=‘checkbox‘ ng-model="formDataObject.week.monday"  style=‘vertical-align:-2px;‘ />星期一</span>
<span style=‘display:block;float:left;padding:7px;‘><input type=‘checkbox‘ ng-model="formDataObject.week.tuesday"  style=‘vertical-align:-2px;‘ />星期二</span>
<span style=‘display:block;float:left;padding:7px;‘><input type=‘checkbox‘ ng-model="formDataObject.week.wednesday"  style=‘vertical-align:-2px;‘ />星期三</span>
<span style=‘display:block;float:left;padding:7px;‘><input type=‘checkbox‘ ng-model="formDataObject.week.thursday"  style=‘vertical-align:-2px;‘ />星期四</span>
<span style=‘display:block;float:left;padding:7px;‘><input type=‘checkbox‘ ng-model="formDataObject.week.friday"  style=‘vertical-align:-2px;‘ />星期五</span>
<span style=‘display:block;float:left;padding:7px;‘><input type=‘checkbox‘ ng-model="formDataObject.week.saturday"  style=‘vertical-align:-2px;‘ />星期六</span>
<span style=‘display:block;float:left;padding:7px;‘><input type=‘checkbox‘ ng-model="formDataObject.week.sunday"  style=‘vertical-align:-2px;‘ />星期日</span>

radio组,只要value赋值,就可以直接在对象中获取

<span style=‘display:block;float:left;padding:1px;‘><input type=‘radio‘ value="all"  ng-model="formObject.valueRange"  name="valueRange"  style=‘vertical-align:-2px;‘ />全部日期</span>
<span style=‘display:block;float:left;padding:1px;margin-left:30px;‘><input type=‘radio‘ value="week" ng-model="formObject.valueRange" name="valueRange"   style=‘vertical-align:-2px;‘ />按星期</span>
<span style=‘display:block;float:left;padding:1px;margin-left:30px;‘><input type=‘radio‘ value="date" ng-model="formObject.valueRange" name="valueRange"   style=‘vertical-align:-2px;‘ />按日期</span>

js取值为$scope.formObject.valueRange 选择全部? 取值为all 选择按星期 取值为week

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读