How to use md5.js within a compontent?

邮差的信 提交于 2019-12-05 12:36:06

JavaScript-MD5 does't export any AMD-Modules, if I see it right. But it defines window.md5. So your app.import will include it in vendor.js and you can call window.md5 in the component.

To get this to work I used:

bower install blueimp-md5 --save-dev

and added import in Brocfile.js

app.import('bower_components/blueimp-md5/js/md5.js');

then add "md5" to predef array as mentioned by Oliver to suppress md5 warning.

Oliver

That's just a jshint linter message.

Open your .jshintrc file, add "md5" to the "predef" object and you are fine.

Vishal

You might need to install the ember-cli-md5 package. This will install all the required dependencies in your node modules. Use this npm install --save-dev ember-cli-md5 to install ember-cli-md5.

Once installed you will need to generate md-5 which will install the browser package via bower. Use this to generate md-5 ember generate md-5.

So, you need to perform following two steps:-

npm install --save-dev ember-cli-md5
ember generate md-5
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!