Disabling editing for other elements is pretty easy. You just need to add a flag to the parent scope which says an element is being edited:
$scope.editing = false
$scope.toggleEdit = function(){
$scope.editing = !$scope.editing;
}
And then make your ng-show
or ng-hide
something like ng-hide="editMode || $parent.editing
.
You can toggle the edit mode using the toggleEdit
function:
ng-click="editMode = true; toggleEdit()"
To solve your second problem, you need to reference the item in the array you want to get access to. You can achieve this with the Arrays indexOf function:
var index = rows._embedded.alternate.indexOf(shift)
rows._embedded.alternate[ index]._embedded.event.distance
Here's your plunkr, updated to work with the above: http://plnkr.co/edit/ZwHpN5MFpS2c1VFjLckU