基于在下拉列表中选择不同的项目,我生成带有复选框的项目的html.如何保留复选框的状态,即每当下拉列表中的值发生变化时选中/取消选中.请参阅此处的plunkr https://plnkr.co/edit/PUG3g7dfTbQjPyIgGLzh?p=preview
脚步:
- uncheck 'abc2'
- change dd value to 'international'
- again change the dd value to 'local'
- here 'abc2' must be unchecked...
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
var data = [
{type: 'local', name: 'abc1', location: 'xyz1', checked: true},
{type: 'local', name: 'abc2', location: 'xyz2', checked: true},
{type: 'international', name: 'abc3', location: 'xyz3', checked: true},
{type: 'local', name: 'abc4', location: 'xyz4', checked: true},
{type: 'local', name: 'abc5', location: 'xyz5', checked: true},
{type: 'international', name: 'abc6', location: 'xyz6', checked: true},
{type: …Run Code Online (Sandbox Code Playgroud) rxjs5 ×1