【发布时间】:2016-08-06 00:11:55
【问题描述】:
我正在尝试制作通知配置页面。基本上,用户应该能够为特定模块选择他希望接收的通知类型。有 3 种类型的通知(电子邮件、SMS 和 UI)。目前我的数组是这样构建的
$scope.modules= [
{
"id": 1,
"name": "Module1",
"notifications": [
{
"notification": "email"
}
]
},
{
"id": 2,
"name": "Module2",
"notifications": [
{
"notification": "sms"
},
{
"notification": "ui"
}
]
}
];
我正在努力实现这个观点
问题: 当我尝试重复某个模块的通知时,如果例如 {"notification": "email"} 不存在,则复选框不会保持未选中状态,而是从视图中删除。
关于如何执行 ng-repeat 的任何想法?谢谢
【问题讨论】:
-
你能把你的代码放在小提琴/plunkr 中吗?
-
@MartijnWelker 我更新了我的问题,小提琴在那里
标签: angularjs checkbox angularjs-ng-checked