Using external angular module in plugin


Is it possible to use external angular module exposed by a library in Grafana plugins? It needs to be added to dependencies of some existing module (e.g. grafana.directives), but unfortunately that’s not possible since grafana modules are already defined and created. I tried some hacks from but it didn’t work for me.
In fact I’m trying to use ng-tags-input which exposes “ngTagsInput” module.


grafana already contains a tags directive in bootstrap-tagsinput

if you want to create a seperate angular module with dependencies do that and then import app from ‘app/app’; then use app.useModule(yourNewModule);


I tried to inject simple module (with one simple directive) using app.useModule. It got registered, but the directive wasn’t rendered. I guess useModule needs to be used before app bootstrap. Are you sure this should work? See


You should just import module with directive, like

import './ng-tags-input';


Yeaa, but then I need to inject “ngTagsInput” as dependency to any grafana module, let’s say “grafana.directives”. How do I do that?


why? it’s already loaded and defined in that module


sorry, I meant the grafana built in tags input