Open joweste opened 7 years ago
I think it is because Angular is putting a watch on the function.
You could try {{ ::ShowMedicamento(item) || 'n/a' }}
and see what that does.
Also you are doing two null checks with that function, why not just do {{item.medicamento || 'N/A'}}
Yes, I already did it and put your tip. About the watch in the function, Is angular putting a watch in the function or x-editable is doing it?
Angular is doing it because of the two way binding.
I am using x-editable angularjs.
When I click to edit a form, I have seen a forever loop into the next method of the controller:
"$scope.ShowMedicamento" called into
{{ ShowMedicamento(item) || 'n/a' }}
I put a log into this method, and I can see it running forever.
After go out from edit mode, the loop stops.
The app works well, but I can see a intensive loop in this method when entering in edition mode.
Is this a normal behaviour?
//controller .... $scope.ShowMedicamento=function(item){ console.log(item.medicamento) return (item.medicamento)?item.medicamento:'N/A' }