Listeler arasında öğeleri sürükleyip bırakmak için açısal olarak kullanılamıyorum. Yapmak istediğim şey (belirli sürükle/bırak koşulları altında) bir onaylama diyaloğuna sahiptir ve kullanıcı diyaloğu iptal ederse listeleri orijinal haline geri döndürür. Güncelleştirme olayının içinde ui.item.sortable.cancel()
yöntemini kullanabilirim, ancak bir söz veren bir model kullanırsam, iptal edilen listelerin nasıl geri alınacağını anlayamıyorum. Herhangi bir tavsiye takdirAçısal iletişim kuralı içinde geri arama iletişim kutusu nasıl beklenir Geri arama geri çağırma
$scope.sortableOptions =
handle: ' > span > span > .task-drag-icon',
connectWith: ".task-subset"
placeholder: "sortable-placeholder",
forcePlaceholderSize: true,
update: (e, ui) ->
if ui.item.sortable.sourceModel == ui.item.sortable.droptargetModel #sort was within the same list
#some other logic here.....
else
droptarget_element = ui.item.sortable.droptarget
if droptarget_element.attr('ng-model') == "task.subTasks"
#need the user to confirm here if they really want to do this drag/drop
modalOptions =
closeButtonText: 'Cancel'
actionButtonText: 'Make SubTask'
headerText: 'Make SubTask?'
bodyText: 'This action will remove any existing task groups as it will become a child task. Is this OK?'
modalService.showModal({}, modalOptions).then (result) ->
console.log "accpted"
,() ->
console.log "cancelled"
#need to call ui.item.sortable.cancel() here, but I cant because the update callback has finished already!!!!
console.log "finished - gets to here immediately as modalService is asyncronous"
return
: İşte benim denetleyicisi ne var (modalService bir önyükleme $ uibModal olan).