I have successfully implemented drag and drop directives in angularJS, and they are functioning properly on my computer's web browser. However, when I tried to use the directives on my touch devices, they did not work. Should I make adjustments to my code to ensure compatibility with touch devices, or do I need to rewrite the directives entirely? Below is a snippet of the code I am currently using.
module.exports = angular
.module('app.dashboard.controller', ['ngTouch'])
.controller('appDashboard', appDashboard)
.directive('draggable', draggable)
.directive('droppable', droppable);
function droppable() {
return {
scope: {
drop: '&',
bin: '='
},
link: function(scope, element) {
// more code here
}
}
}
function draggable() {
return {
scope: {
drag: '&'
},
link: function(scope, element) {
// more code here
}
}
}