opitzconsulting / jquery-mobile-angular-adapter

jquery mobile angular adapter
MIT License
517 stars 114 forks source link

listview not updated every time when adding or removing data in javascript #208

Closed rodriguezc closed 11 years ago

rodriguezc commented 11 years ago

Thank you Tobias for your work and for this great adapter!

The list is not updated every time when I push or remove data from the binded array.

See the fiddler: http://jsfiddle.net/EsQBa/

MartineFrancken commented 11 years ago

I tried to see your problem in the fiddle, but it's working correct for me. When I push data it will add it directly to the listview and when I remove data it will get directly removed from the listview.

rodriguezc commented 11 years ago

Thanks Martine. It seems that it occurs occurs only when adding null/empty data to the list.

tbosch commented 11 years ago

Hi, the problem was that initially the field $scope.newFriend had the value undefined and the adapter did not detect a change when this was added to the array. The previous commit fixes that. A workaround would have been to set $scope.newFriend = null initially.

Tobias