I am trying to import the trackingjs library (https://www.npmjs.com/package/tracking) into my ionic2 project.
By following the documentation (https://ionicframework.com/docs/v2/resources/third-party-libs/) I can import the lodash library and use it.
But with tracking js all I get is an empty object (tracking === {})
import tracking from 'tracking/build/tracking';
I installed the tracking module with npm and then installed the corresponding types (https://www.npmjs.com/package/@types/tracking). I can see the code from the module in my main.js file when using ionic serve so it seems to be included correctly, but I can't get it to work.
Did I miss anything obvious or is there something more to do with that library? Any help will be appreciated.
Seems todo the trick, not in ionic but another Angular 4 project.
After much trial and error I have managed to import and use tracker.js into my Ionic 2 app with typescript 2.2.1.
My problem was to detect the faces from a user selected photo, before it is uploaded.
Here are my solution steps
1st Install tracking.js via npm
2nd import the tracking.js file into your ionic page.
3rd import the face.js Classifier file after the import 'tracking/build/tracking' line and declare the necessary variables
4th use the tracker.js api in your code (this can still be optimized)
If you want to track all faces, eyes, and mouth then use an array of classifier name as parameter after importing all the Classifier files
Try this.