我在我的项目中安装了angular2-recaptcha(https://github.com/xmaestro/angular2-recaptcha).
我添加了systemjs.config.js:
System.config({
map: {
'angular2-recaptcha': 'node_modules/angular2-recaptcha'
},packages: {
app: {
format: 'register',defaultExtension: 'js'
},'angular2-recaptcha': {defaultExtension: 'js',main:'index'}
}
});
index.html的:
但我在浏览器控制台中收到此错误:
Uncaught ReferenceError: System is not defined
at localhost/:29
compiler.es5.js:15996 Uncaught Error: Unexpected module 'ReCaptchaModule' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation.
at syntaxError (compiler.es5.js:1690)
at compiler.es5.js:15430
at Array.forEach (
请帮我!我的错误在哪里?
最佳答案
您需要加载SystemJS库,而不仅仅是配置:
此外,不推荐使用系统使用,使用SystemJS whereSystem是全局对象,例如,而不是System.import useSystemJS.import.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。