0

I work on an ember-cli project. I want to use a javascript library in the route.

It is called CarrotSearchFoamTree.

In order that it will work i added in Brocfile.js

app.import('vendor/foamtree/carrotsearch.foamtree.js');

When i write in my route

 var foamtree = new CarrotSearchFoamTree({
         id: "visualization",
         pixelRatio: window.devicePixelRatio || 1,
         initializer: "treemap",
         relaxationVisible: false,
         relaxationQualityThreshold: 5,
         rolloutDuration: 0,
         pullbackDuration: 0,
         finalCompleteDrawMaxDuration: 50,
         finalIncrementalDrawMaxDuration: 20
       });

jshint in the build tells me:

routes/search.js: line 104, col 25, 'CarrotSearchFoamTree' is not defined.

How can i avoid this error?

Thanks,

David

David Michael Gang
  • 7,107
  • 8
  • 53
  • 98

1 Answers1

2

Just add it to the .jshintrc configuration like:

"predef": {
  "CarrotSearchFoamTree": true
}

And you shouldn't see the warning anymore.

Altrim
  • 6,536
  • 4
  • 33
  • 36