我使用了与此小提琴中提到的完全相同的代码
angular.module('MyModule', []).directive('autoComplete', function($timeout) {
return function(scope, iElement, iAttrs) {
iElement.autocomplete({
source: scope[iAttrs.uiItems],
select: function() {
$timeout(function() {
iElement.trigger('input');
}, 0);
}
});
};
});
但对我来说它是抛出未定义的错误(iElement.autocomplete undefined不是一个函数)。我注意到上面的例子他们使用了角度1.0.0,但我使用的是角度1.2.2
我被困在这里,请建议