简体   繁体   English

列表中选中的AngularJS复选框

[英]AngularJS checkbox selected in a list

I have a list called positions that has N positions in them. 我有一个名为positions的清单,其中有N个职位。 I also have a user user that has an attribute user.positions that has some of the positions assigned to. 我也有一个用户user ,该用户具有一个属性user.positions ,该属性已分配了一些位置。

I want to show a form with all the possible positions, and the positions that the user already has to be checked. 我想显示一个表格,其中包含所有可能的位置,以及必须检查用户的位置。

Is this something I can do inside the HTML, or do I need to loop through both in my logic and create a new variable? 这是我可以在HTML内部执行的操作,还是需要在我的逻辑中循环遍历并创建一个新变量?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM