Javascript &引用;无法读取属性';然后';“未定义”的定义;角阻力
我尝试使用角度拖放,但是当我尝试一个基本的例子时,我得到了错误。我的密码-Javascript &引用;无法读取属性';然后';“未定义”的定义;角阻力,javascript,angularjs,drag-and-drop,Javascript,Angularjs,Drag And Drop,我尝试使用角度拖放,但是当我尝试一个基本的例子时,我得到了错误。我的密码- <apex:page standardStylesheets="false" sidebar="false" showHeader="false"> <style> table, th , td { border: 1px solid grey; border-collapse: collapse;
<apex:page standardStylesheets="false" sidebar="false" showHeader="false">
<style>
table, th , td {
border: 1px solid grey;
border-collapse: collapse;
padding: 5px;
}
</style>
<html ng-app="myApp">
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-responsive.min.css" rel="stylesheet" />
<div ng-controller="dragDropController">
<div class="row-fluid">
<div class="span6">
<div class="btn btn-primary" data-drag="true" ng-model="list" jqyoui-draggable="{animate: true}">{{list.title}}</div>
</div>
<div class="span6">
<div class="thumbnail" data-drop="true" ng-model="droppedList" jqyoui-droppable="{beforeDrop: 'beforeDrop'}"></div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min.js"></script>
<script src="{!$Resource.AngularDragDrop}" />
<script>
angular.module('myApp', ['ngDragDrop']).controller('dragDropController', function($scope, $http) {
$scope.list = {title : 'Drag me..!!'}
$scope.droppedList = {title: 'Drop place'};
$scope.beforeDrop = function() {
console.log('Before dropping..!!');
};
});
</script>
</html>
</apex:page>
表,th,td{
边框:1px纯灰;
边界塌陷:塌陷;
填充物:5px;
}
{{list.title}
angular.module('myApp',['ngDragDrop']).controller('dragDropController',函数($scope,$http){
$scope.list={title:'拖动我..!!'}
$scope.droppedList={title:'dropplace'};
$scope.beforeDrop=函数(){
console.log('删除之前…!!');
};
});
有人能帮我吗。??
我尝试过使用相同不同版本的angular,也尝试过从实际站点示例复制angular版本,但仍然面临相同的错误
谢谢,
RaybeforeDrop函数应返回承诺 插件在删除之前执行
,,通常要求用户确认,然后它“删除”(或不删除)
由于您没有等待用户输入,为了消除错误,您可以注入$q
并返回最愚蠢的承诺,可以这么说:
$scope.beforeDrop = function () {
console.log('Before dropping..!!');
return $q.when();
}
但是,beforedop
的最终外观更像:
$scope.beforeDrop = function () {
// open modal
// ...
return modalPromise;
}
脚本标记无法自动关闭这不是问题这是问题之一