How to add and use npm package cryptocoins-icons in my AngularJS app

时间:2018-02-03 09:47:46

标签: angularjs node.js npm blur-admin

I am building a custom website built on top of template - https://github.com/akveo/blur-admin

I am new to npm. I wanted to use a npm package named cryptocoins-icons. I went to my project folder root and ran the command npm i cryptocoins-icons. The package is added in my project.json.

Now in one my html when I write - <td><i class="cc BTC"></i>{{item.name}}</td>

<i class="cc BTC"> part should have displayed bitcoin icon there.

I know I am definitely missing something, but I don't know what. Please help

1 个答案:

答案 0 :(得分:0)

我不喜欢当前的解决方案,但是至少在找到更好的解决方案之前,它一直在起作用。

安装依赖项后:

npm install cryptocurrency-icons

然后,您可以在资产文件夹中进行复制:

cp node_modules/cryptocurrency-icons/svg/color/* src/assets/cryptoicons/

使用此技巧,您可以创建如下的img:

<img src="/assets/cryptoicons/{{symbol}}.svg"/>

符号是加密符号(例如wave或xlm)。

这不是一个很干净的解决方案,但是...有效(理想情况下,我想使用典型的CSS图标波形样式)。 希望对您有帮助!