【发布时间】:2016-07-22 00:33:49
【问题描述】:
我知道这个问题被问了大约 100 次,但我收到了这个错误。请检查屏幕截图。
错误:SyntaxError: Unexpected token http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/date-formatter.js:2:14) 在评估 (http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/date-formatter.js:13:4) 评估http://localhost:3000/moment 评估http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/date-formatter.js 评估http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/datepicker-inner.js 评估http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/datepicker.js 评估http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/datepicker-popup.js 评估http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker.js 评估http://localhost:3000/node_modules/ng2-bootstrap/ng2-bootstrap.js 加载http://localhost:3000/app/main.js时出错
我遵循了修复系统配置的解决方案
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
},
'ng2-bootstrap': {
defaultExtension: 'js'
}
},
map: {
// place for ng2 modules mapping
'ng2-bootstrap': 'node_modules/ng2-bootstrap'
}
});
但是在这个解决方案之后我得到了错误并且页面没有加载......
任何知道要遵循的步骤的人请告诉我。
【问题讨论】:
-
I know this question is asked about 100 times.... -
请发布您的 datepickerformatter 代码
标签: angular ng2-bootstrap