我有一个ember应用程序,也许它开始作为Visual Studio的一些MVC或一些项目模板,后来他们添加了,现在我正努力添加“ember-真相-助手”在许多方面像使用纱添加或npm添加,在任何方式它没有被添加,所有我试图做的是执行下面的代码:
{{#if (eq "complete" "complete")}} {{! works! }}
{{log 'Complete 1'}}
{{/if}}
我收到以下错误:js:43618未捕获(在承诺中)错误:编译错误:情商不是帮手
我的package.json文件如下所示
{
"name":"ims-ember",
"version":"1.0.0",
"main":"index.js",
"scripts":{
"build":"ember build",
"babel-preset-env":"^1.7.0",
"lint:hbs":"ember-template-lint .",
"babel-preset-es2016":"^6.24.1",
"lint:js":"eslint .",
"bootbox.js":"^4.3.0",
"start":"JOBS=1 ember serve",
"bootstrap":"^3.3.7",
"test":"ember test"
},
"author":"",
"license":"ISC",
"description":"",
"dependencies":{
"babel-core":"^6.26.3",
"babel-polyfill":"^6.26.0",
"babel-preset-env":"^1.7.0",
"babel-preset-es2016":"^6.24.1",
"bootbox.js":"^4.3.0",
"bootstrap":"^3.3.7",
"bootstrap-datepicker":"^1.9.0",
"bootstrap-hover-dropdown":"^2.2.1",
"chosen-js":"^1.8.7",
"datatables":"^1.10.18",
"ember-cli-windows":"github:felixrieseberg/ember-cli-windows",
"file-loader":"^4.2.0",
"font-awesome":"^4.7.0",
"gulp":"^4.0.2",
"gulp-babel":"^8.0.0",
"gulp-clean":"^0.4.0",
"gulp-clean-css":"^4.2.0",
"gulp-concat":"^2.6.1",
"gulp-concat-sourcemap":"^1.3.1",
"gulp-declare":"^0.3.0",
"gulp-filter":"^6.0.0",
"gulp-if":"^3.0.0",
"gulp-insert":"^0.5.0",
"gulp-less":"^4.0.1",
"gulp-replace":"^1.0.0",
"gulp-uglify":"^3.0.2",
"gulp-wrap":"^0.15.0",
"gulp-wrap-file":"^0.1.2",
"handlebars":"^4.4.2",
"icons-loader":"0.0.6",
"inputmask":"^4.0.9",
"jquery":"^3.4.1",
"jquery-ui":"^1.12.1",
"json-stringify-safe":"^5.0.1",
"lightbox2":"^2.11.1",
"loader-utils":"^1.2.3",
"moment":"^2.24.0",
"mssql":"^5.1.0",
"node-sass":"^4.12.0",
"npm":"^6.13.0",
"popper.js":"^1.15.0",
"rimraf":"^3.0.0",
"sass-loader":"^8.0.0",
"schema-utils":"^2.4.1",
"toastr":"^2.1.4",
"typeahead.js":"^0.11.1",
"uglifyjs-webpack-plugin":"^2.2.0",
"uuid":"^3.3.3"
},
"devDependencies":{
"@babel/core":"^7.6.2",
"@babel/preset-env":"^7.6.2",
"babel-loader":"^8.0.6",
"css-loader":"^3.2.0",
"ember-truth-helpers":"^2.1.0",
"install":"^0.13.0",
"less-loader":"^5.0.0",
"style-loader":"^1.0.0",
"webpack":"^4.41.0",
"webpack-cli":"^3.3.10"
}
}
有什么需要帮忙吗?
2条答案
按热度按时间c0vxltue1#
我已经修复了这个关于帮助函数的问题--这里是这样的,以前的开发者把所有的帮助函数放在一个文件中,他造成的混乱是,他把其他文件和那些帮助函数放在不同的目录中--看起来我需要清理这个问题。你检查定义的建议帮助我查看webpack.config.js(async helpers,async __parts),他在这里将所有文件脚本组合起来,生成一个js文件,并将其写入app.js。(或者Ember我不确定)后面是camel的大小写。例如,对于一个helper-function,他在同一个ifCond.js文件中编写如下:转换为“replace”,我们可以在车把中使用它作为replace
如果假设,如果有两个单词-那么它遵循 Camel 的外壳(你知道它)。完全完成,我已经写了一些我自己的助手函数的需要-非常感谢大家谁跳进来帮助我-非常感谢,我不知道该如何形容我是多么高兴-谢谢。我自己的助手函数如下:
我用下面的语法来调用它们:
再次感谢大家在这个小组。:祈祷:
jmo0nnb32#
我已经修复了这个问题的帮助函数-答案是下面的链接:添加自定义助手函数或ember-truth-helpers到我的Ember应用程序