lumapps/lumX

lx-select doesn't update selected values

Open

#352 创建于 2015年9月25日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)JavaScript (1,974 star) (281 fork)batch import
help wanted

描述

Hi,

I'm using lx-select 'multiple' and I want to deselect some values from JS. I couldn't find any example how to do this so here are steps to reproduce:

http://ui.lumapps.com/directives/selects with Batarang Chrome plugin:

  • If in dev console I execute: $scope.ajax.selected = 'alf'; $scope.$apply() it automagically updates value to ALF (1986–1990) I assume I should be able to do the same with dropdown based on selects.selectedPersons.
  • When I execute JSON.stringify($scope.selects.selectedPersons) from console I get: "[{"name":"Wladimir","email":"wladimir@email.com","age":30},{"name":"Estefanía","email":"estefanía@email.com","age":16}]" But after executing $scope.selects.selectedPersons.splice(0,1); $scope.$apply() which removes Wladimir from array leaving only "[{"name":"Estefanía","email":"estefanía@email.com","age":16}]" I still see Wladimir selected in lx-select. I cannot find any way to remove him from selected options from within JS. Is there any way to do that?

贡献者指南

lx-select doesn't update selected values · lumapps/lumX#352 | Good First Issue