【发布时间】:2015-04-16 10:47:02
【问题描述】:
我需要从 emberjs 应用程序中的字符串中删除变音符号。 我为此找到了一个插件:fold-to-ascii 但我不知道如何在我的应用中使用它。
我通过 npm 添加了这个插件,它在我的应用程序的 node_modules 文件夹下可见
在文档中这个插件的用法是:
var foldToAscii = require("fold-to-ascii");
foldToAscii.fold("★Lorém ïpsum dölor.")
但我得到一个例外:
Uncaught Error: Could not find module fold-to-ascii
还尝试像@Kori John Roys 建议的那样导入它:
import foldToAscii from 'fold-to-ascii'
但它只给了我新的例外:
Error while processing route: transports.index
Could not find module fold-to-ascii imported from test-ember/pods/transport/model
我做错了什么?
【问题讨论】:
标签: javascript ember.js plugins npm require