vendredi 17 avril 2015

Import dependency with bower Ember CLI - could not find module

I'm trying to use Markdown-it in Ember Helper. First I installed it with Bower and tried to import it.



app.import('bower_components/markdown-it/dist/markdown-it.js');


In helper:



import MarkdownIt from "markdown-it";


This is showing error Could not find module: markdown-it. Then I tried to use Ember-browserify and install Markdown-it via npm. I tried to import it in helper



import MarkdownIt from "npm:markdown-it";

export default Ember.Handlebars.makeBoundHelper(function(input){
var result = MarkdownIt.render(input);
return new Ember.Handlebars.SafeString(result);
});


This is showing error TypeError: a.default.render is not a function.


Aucun commentaire:

Enregistrer un commentaire