Sunday, 9 September 2018

CamanJs with angular 6

I am trying to use camanjs with angular 6. How to add js lib and use it with angular when there are no types for it on npm. I follow many steps

  • install caman using npm

  • adding it to angular.json as a script using its path in node modules

  • import it into the component like

import * as Caman from 'path to caman in node module'

  • the in AfterViewInit I use it like
  ngAfterViewInit() {
       Caman('#image-id', function () {
            this.brightness(10);
            this.contrast(20);
          });
     }

but when start server I get this error

enter image description here

link to code: https://stackblitz.com/edit/angular-d5g941



from CamanJs with angular 6

No comments:

Post a Comment