如何在 angular 中包含一个没有应用依赖性的 Bower 库

How do you include a bower library in angular that does not have app dependency

我正在尝试使用没有要添加到 AngularJS 模块的依赖项的 Bower 库。

通常要在 angular 中包含一个 bower 库,我会安装 bower 库,然后将该库添加到我的 app.js 中,就像这样

angular.module('myModule', ['bower library']);

但是我正在尝试添加这个没有要注入的 angular 依赖项的凉亭库 https://github.com/Caged/d3-tip。所以我没有什么可以注入angular.module。

我的总体问题是如何将没有 angular 依赖项的 Bower 库注入到 angular 应用程序中?

My overall question is how does one get a bower library that does not have an angular dependency to be injected into an angular app?

你不知道。如果库不是 Angular 模块,则不能(也不需要)将其作为依赖项注入到 Angular 模块中。

好消息是,在大多数情况下,像这样的库可以开箱即用地在全球范围内使用。在这种情况下,看起来该库向 D3.js 添加了功能。所以当你使用 d3 时,只需使用 d3.tip().