0

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

Community
  • 1
  • 1
Shubham Gupta
  • 159
  • 1
  • 14

1 Answers1

1

I don't like my current solution but is working at least until I find something better.

After installing the dependency:

npm install cryptocurrency-icons

Then you can copy inside your assets folder:

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

With this trick you can create an img like this:

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

Where symbol is the crypto symbol (for example waves or xlm).

Not a very clean solution but... it works (ideally I would like to use the typical css icon-waves style). Hope it helps!

Carlos Verdes
  • 3,037
  • 22
  • 20