I will build an Ionic project using Ionic 2, Angular 2, and TypeScript to test the structure a bit. I need to include an external library ( ntc.js ) in my project, since I need it to call hex colors.
I know that including the Javascript library for TypeScript should work, since everything that works in JS works in TS. I just don't want to include it in the wrong way.
I tried adding the library to www / build / js but it doesn't seem to work and it doesn't seem like a good way to do this. I tried to find ways to do this, but found nothing (maybe because Angular 2 and Ionic 2 are still fresh).
Things like:
import * as ntc from '../../js/ntc';
doesn't seem to work even if my library is in the right place. TypeScript doesn't seem to read my file properly if it reads it at all.
What is a good way to do this? Where should I put my .js file in the project directory?
source
share