In my ember js
app, created using ember-cli
, I want to create a real time graph to be displayed. I thought of using ember-rickshaw
.
I followed the example found here, and then tried to run a simple code. The problem is it gives me this error uncaught reference: Rickshaw is not defined
. I have installed rickshaw, ember-rickshaw and d3 all using npm
. and hence they reside in the node_modules folder. After this error, I tried to include their corresponding files in the brocfile.js
, this way:
app.import('node_modules/ember-rickshaw/dist/ember-rickshaw.min.js');
app.import('node_modules/rickshaw/rickshaw.js');
app.import('node_modules/d3/d3.min.js');
but then it says it can not find the files, though the files are at exactly these locations.
May be I'm missing how to import any javascript library into ember cli.
Following this SO link, I tried to use
<script src="../../node_modules/ember-rickshaw/dist/ember-rickshaw.min.js"/>
<script src="node_modules/rickshaw/rickshaw.js"/>
<script src="node_modules/d3/d3.min.js"/>
in the template file /my_graph.hbs
. But it again gives the same error to not have defined the Rickshaw reference.
Any help is greatly appreciated. Thanks.
Aucun commentaire:
Enregistrer un commentaire