使用ng-repeat来实现checkbox列表,在这个时候,我们想给其中一个或多个checkbox的状态为checked。

以前有实现类似《https://www.cnblogs.com/insus/p/9435321.html

但是这个只能在数据源来指定是否为selected。

今天,Insus.NET想使用另外一种方法,即是指定一个值来实现。

 

ng-repeat中的ng-checked

 

上图高亮的代码,如果日期为当天的日期的,作为选中的状态。

ng-repeat中的ng-checked

 

最后的结果:

ng-repeat中的ng-checked

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-03-13
  • 2022-02-20
  • 2022-12-23
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2022-12-23
相关资源
相似解决方案