0
我试图使用autoComplete Directive实现自动完成。 这里是我的directive
:angular.js - iElement不是函数
angular.module('myApp', []).directive('autoComplete', function($timeout) {
return function(scope, iElement, iAttrs) {
iElement.autocomplete({
source: scope[iAttrs.uiItems],
select: function() {
$timeout(function() {
iElement.trigger('input');
}, 0);
}
});
};
});
的错误是undefined is not a function
为iElement
。 我在我的应用中包含了angular
和jQuery
,但我的角度版本是1.3
(不像示例),这是原因吗?是否有这样的解决方案?
给我们,错误的例子。 – WorkWe
其实你的例子工作没有任何错误对我来说 - http://jsfiddle.net/swfjt/4935/ – shershen
它工作正常与我:) – WorkWe