2017-12-18 249 views
-3

我需要将[此库] http://scottjehl.github.io/picturefill/加入到我的angular-cli项目中。我怎样才能做到这一点?如何将外部JS库包含到Angular CLI项目中?

我试过这样https://stackoverflow.com/questions/40526476/using-external-library-with-angular-cli
像这样https://stackoverflow.com/questions/40526476/using-external-library-with-angular-cli
这个解决方案不是为我工作。我仍然在控制台
'图片填充未定义'。

+1

没有在文件入门部分。 – dfsq

+0

非常有帮助的人:/ – Belouccio

回答

0

我觉得做一个简单的谷歌搜索会给你答案:

https://github.com/angular/angular-cli/wiki/stories-third-party-lib

+0

你认为我不知道谷歌?))我尝试像这样https://stackoverflow.com/questions/41120754/using-external-js-libraries-in-my-angular- 2项目 和这样的https://hackernoon.com/how-to-use-javascript-libraries-in-angular-2-apps-ff274ba601af 和一些更多的链接,但JS文件仍然不工作 – Belouccio

+0

好吧,你的首先问题不是很详细。现在你只是一直说它不起作用。它适用于我们所有人,所以你可以从说一个标准项目中分离出来。也许图书馆不兼容? – Carsten

+0

对不起我的问题。只有通过在index.html中插入

相关问题