我知道這個問題被問了100次,但我得到這個錯誤。請檢查截圖。Angular 2錯誤:SyntaxError:意外的令牌<
Error: SyntaxError: Unexpected token < at Object.eval (http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/date-formatter.js:2:14) at eval (http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/date-formatter.js:13:4) Evaluating http://localhost:3000/moment Evaluating http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/date-formatter.js Evaluating http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/datepicker-inner.js Evaluating http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/datepicker.js Evaluating http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/datepicker-popup.js Evaluating http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker.js Evaluating http://localhost:3000/node_modules/ng2-bootstrap/ng2-bootstrap.js Error loading 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'
}
});
,但這個解決方案後,我得到的錯誤和頁面沒有加載的解決方案......
人知道請遵循的步驟請讓我知道。
'我知道這個問題被問到100次左右.... ... –
請發佈您的代碼爲datepickerformatter – KnowHoper