Hi , I am facing some issue in loading directive , when i use the directive
i am getting error "autocomplete" not an function , after that identify
jquery plugin not getting load before directive load , can you please give
how to implement lazy load this directive
app.directive('ngAutoComplete', function($timeout) {
console.log("enter")
return function(scope, iElement, iAttrs) {
iElement.autocomplete({
source: scope[iAttrs.uiItems],
select: function() {
$timeout(function() {
iElement.trigger('input');
}, 0);
}
});
}
}) ;
i found some code snippet from google , but that is not working
function lazyLoad(){
app.directive('ngAutoComplete', function($timeout) {
console.log("enter")
return function(scope, iElement, iAttrs) {
iElement.autocomplete({
source: scope[iAttrs.uiItems],
select: function() {
$timeout(function() {
iElement.trigger('input');
}, 0);
}
});
}
}) ;
}
$(lazyLoad)
This method is called , but directive not getting intilized . can you
please anyone give the solution for this
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.