These are chat archives for AngularClass/NG6-starter

10th
Jan 2016
Andrew Lombardi
@kinabalu
Jan 10 2016 00:39
so I’m trying to integrate allmighty-autocomplete into my angular project, but getting an error about Error: [$injector:unpr] Unknown provider: autocompleteProvider <- autocomplete
Sergey Protko
@fesor
Jan 10 2016 08:00
@kinabalu did you specify module depenedncies?
Andrew Lombardi
@kinabalu
Jan 10 2016 16:26
@fesor, yeah:
import autocomplete from 'allmighty-autocomplete';

let navbarModule = angular.module('navbar', [
  uiRouter,
  'autocomplete'
])
@fesor it errors if I pass it into the controller.
Sergey Protko
@fesor
Jan 10 2016 16:40
as I can see it doesn’t have autocomplete service
only directive
so don’t know what you are trying to inject into controller
Andrew Lombardi
@kinabalu
Jan 10 2016 17:09
well I guess I just don’t know how to use the directive without getting it imported?
Sergey Protko
@fesor
Jan 10 2016 17:10
@kinabalu you already imported angular module which contains this directive
that it
just use directive
please remember
Andrew Lombardi
@kinabalu
Jan 10 2016 17:12
@fesor ah, so I don’t have to put it in with the modules, just import it and then use?
Sergey Protko
@fesor
Jan 10 2016 17:13
@kinabalu ? you should import module (what you dead already) and specify dependency of your angular module from this third party angular module
AngularJS (1.x branch) has it’s own module system which already handles all dependencies across different modules.
ES6 modules with angularJS used ONLY to link modules with each other and also to register your stuff in your modules.
since directives, services and other stuff is registered in angular modules - the only thing that needed from ES6 modules is to link angular modules…
don’t know is it clarify this enough..
Andrew Lombardi
@kinabalu
Jan 10 2016 17:16
hrmm
so are you saying that as long as it’s in the modules dir/ it can be seen for directives and services?
or that just the import is required to bring it into angular?
Andrew Lombardi
@kinabalu
Jan 10 2016 17:26
@fesor i’m completely missing the boat on this aren’t I :(
Sergey Protko
@fesor
Jan 10 2016 17:27
yes, ES6 imports is used only to link stuff to angular
then angular’s module system will handle all the stuff
all third party solutions for angular 1.x comes as angular module
the only thing that you should do is to import angular module and then specify dependency of your module from other (just as usual, without ES6)
Andrew Lombardi
@kinabalu
Jan 10 2016 17:35
ahh so there was no need to pass the module to the controller because, it already works in angular 1.xs module system
Andrew Lombardi
@kinabalu
Jan 10 2016 18:09
@fesor is there a way to reference css from an imported node module? specifically the allmighty-autocomplete that I was talking about earlier? i’ve tried several methods but none successful. I use @import but usually for url’s or stuff within the directory structure in the project
and it’s in node_modules/allmighty-autocomplete/style/autocomplete.css