JustGoscha / allmighty-autocomplete

Simple to use autocomplete directive in a module for AngularJs!
MIT License
392 stars 232 forks source link

with requirejs #64

Open rsuharta opened 9 years ago

rsuharta commented 9 years ago

how do i register the autocomplete.js properly.. i'm getting error:

Uncaught ReferenceError: angular is not defined app/bower_components/allmighty-autocomplete/script/autocomplete.js:3

I'm using the angular + requirejs seed (https://github.com/tnajdek/angular-requirejs-seed) and my registration as follow:

require( [ 'angular', 'app', 'autocomplete', 'routes' ], function(angular, app, autocomplete, routes) { var $html = angular.element(document.getElementsByTagName('html')[0]);

angular.element().ready(function() {
    angular.resumeBootstrap([app['name']]);
});

});

gostbuster commented 9 years ago

Hi, I'm using this plugin too with requirejs,

You should add a dependancy to angular in your config.j file

 'autocomplete': {deps: ['angular']},