fix(ionReorderButton): fix onReorder not triggering angular digest

This commit is contained in:
Andrew Joslin
2014-05-20 08:58:26 -06:00
parent 4d793fd9f4
commit cc46735c82
3 changed files with 18 additions and 12 deletions

View File

@@ -250,7 +250,12 @@ function($animate, $timeout) {
onReorder: function(el, oldIndex, newIndex) {
var itemScope = jqLite(el).scope();
if (itemScope && itemScope.$onReorder) {
itemScope.$onReorder(oldIndex, newIndex);
//Make sure onReorder is called in apply cycle,
//but also make sure it has no conflicts by doing
//$evalAsync
itemScope.$evalAsync(function() {
itemScope.$onReorder(oldIndex, newIndex);
});
}
},
canSwipe: function() {