上下文:使用JavaScript和AMD模块(如require.js)编写的单页web应用程序
用AMD模块实现i18n的更好的方法是什么?
让我们说:
translation.js返回一些i18n函数
require([..modules files., 'translation.js' ], function(.modules.. , t ){
here in the code/view templates I use t('give_me_text') function
})
这样的方法可以吗?
在浏览器上第二次刷新时,在angualr4+webpack3出现以下错误的情况下成功生成prod build后,iam出现以下错误uncaught exception: reflect-metadata shim is required when using class decorators
如果我使用以下脚本<script src="Reflect.js"></script>更新index.html
它工作得很好,但是为什么我需要把它放在index.html中呢?不是在webpack main.bundle.js里面渲染的吗?