我正在尝试将ng2-validation集成到基于Angular2 angular-seed的项目中。我已按照ng2-validation文档中提到的步骤操作,但我收到以下错误。请帮助我。
"(SystemJS) Unexpected token <
SyntaxError: Unexpected token <
at Object.eval (http://localhost:5555/node_modules/ng2-validation/dist/directives/range-length.js:13:10)
at eval (http://localhost:5555/node_modules/ng2-validation/dist/directives/range-length.js:43:4)
at eval (http://localhost:5555/node_modules/ng2-validation/dist/directives/range-length.js:44:3)
Evaluating http://localhost:5555/node_modules/ng2-validation/dist/
Evaluating http://localhost:5555/node_modules/ng2-validation/dist/directives/range-length.js
Evaluating http://localhost:5555/node_modules/ng2-validation/dist/directives.js
Evaluating http://localhost:5555/node_modules/ng2-validation/dist/index.js
Evaluating http://localhost:5555/app/app.module.js
Evaluating http://localhost:5555/app/main.js
Error loading http://localhost:5555/app/main.js"
答案 0 :(得分:0)
将此配置用于karma.conf.js
中的文件数组:
{
pattern: 'node_modules/ng2-validators/*.js',
included: false,
watched: false
},
{
pattern: 'node_modules/ng2-validators/**/*.js',
included: false,
watched: false
}
基于ng2-validators版本,您可以使用链接中指定的配置:https://github.com/Nightapes/ng2-validators/issues/11