当我选择任何值时,它会给我错误,当我对任何项目进行聚焦时,它会再次给出相同的错误。
$("#auto").autocomplete({
source: function (request, response) {
var posting = $http({
type: "GET",
url: "/auto",
data: request
}) // request is the value of search input
posting.success(function (data) {
console.log('hello43434');
// Map response values to fiedl label and value
response($.map(data, function (el) {
return {
label: el.name,
value: el._id
};
}));
})
posting.error(function (error) {
console.log(error);
})
},
这是我所有文件的序列
<head>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/themes/smoothness/jquery-ui.css">
<script src="schscript/angular.js"></script>
<script src="schscript/schAngularController.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.13/angular-ui-router.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"></script>
</head>