Skip to content

Instantly share code, notes, and snippets.

@tikitikipoo
Created February 26, 2014 09:19
Show Gist options
  • Save tikitikipoo/9226339 to your computer and use it in GitHub Desktop.
Save tikitikipoo/9226339 to your computer and use it in GitHub Desktop.
grunt buildするとこっちだとうまくいかない
(function () {
var autoComplete = function($timeout) {
return function(scope, iElement, iAttrs) {
iElement.autocomplete({
source: scope[iAttrs.uiItems],
select: function() {
$timeout(function() {
iElement.trigger('input');
}, 0);
}
});
};
};
angular.module('sample').directive('autoComplete', autoComplete);
}());
こっちだとうまくいく。わけわかめ。
(function () {
angular.module('sample').directive('autoComplete', function($timeout) {
return function(scope, iElement, iAttrs) {
iElement.autocomplete({
source: scope[iAttrs.uiItems],
select: function() {
$timeout(function() {
iElement.trigger('input');
}, 0);
}
});
};
});
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment