How do i check checkbox which has value of for example 5 with angularjs.

如何勾选复选框,它的值为例5。

I am getting JSON with all values of checkbox that needs to be checked , but i cant find anywhere how to automaticaly check checkbox with value of , with angular js.

我得到的JSON是需要检查的复选框的所有值,但是我找不到任何地方可以用角js自动选中值为的复选框。

2 个解决方案

#1


2

You can use the ngChecked directive for checking and unchecking a checkbox

您可以使用ngChecked指令来检查和取消检查复选框

Also if you want for example to set a checkbox to checked when the value is 5:

同样,如果你想设置一个复选框,当值是5的时候:

<input type="checkbox"  ng-model="checkbox_model" ng-checked="data.value=='5'"/>

更多相关文章

  1. $ postLink的角度组件/指令运行得太早
  2. 等待执行所有ajax回调的最佳解决方案
  3. element.replaceWith在自定义指令的链接中仅在第一次调用时工作
  4. 【问题解决方案】ImportError: No module named 'pygal'
  5. Python 黏包及黏包解决方案
  6. Mac下MySQL-python安装及EnvironmentError: mysql_config not fo
  7. Python 2.6.2中的ElementTree处理指令支持?
  8. 无法安装ndg-httpsclient或者我的解决方案错误
  9. 通过指令“ps -l”查看进程信息

随机推荐

  1. Mysql基础之字符集与乱码
  2. Sqoop_详细总结 使用Sqoop将HDFS/Hive/HB
  3. 不知道有人在mysql5.0上 针对10亿条数据
  4. mysql中的隐式提交
  5. MYSQL在触发器中怎样实现‘根据条件来确
  6. MySQL“在建立到SQL Server的连接时发生
  7. mysql has gone away 的问题解决 --- ODB
  8. PHP MYSQL无法在While或For循环中获取数
  9. MySQL的ibdata1文件占用过大瘦身
  10. 数据库keepalived部署文档