亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

ngx-monaco-editor:無法從 node_modules

ngx-monaco-editor:無法從 node_modules

滄海一幻覺 2021-08-20 15:42:17
我想在我的項目中包含 ngx-monaco-editor 以在前端創建一個類似計算器的屏幕,該屏幕顯示用戶單擊相應按鈕時輸入的文本。我已經為此安裝了 ngx-monaco-editor(版本 6.0.0)。依賴項已包含在 app.module.ts 中,我已將 glub 添加到 angular.json 文件中的資產中。app.component.hlml :<ngx-monaco-editor [options]="editorOptions" [(ngModel)]="code"></ngx-monaco-editor>app.component.ts :editorOptions = {theme: 'vs-dark', language: 'javascript'}; code: string= 'function x() {\nconsole.log("Hello world!");\n}';編輯器沒有被渲染。我反而收到一個錯誤,我的 loader.js 文件沒有被找到。http://localhost:4200/assets/monaco/vs/loader.js net::ERR_ABORTED 404(未找到)@base-editor.js:65loader.js 文件位于 node_modules/ngx-monaco-editor/assets/monaco/vs/loader.js,我可以導航到它。錯誤發生在 base-editor.js,第 65 行。此文件的位置是 node_modules/ngx-monaco-editor/base-editor.js
查看完整描述

2 回答

?
qq_遁去的一_1

TA貢獻1725條經驗 獲得超8個贊

10.0.0 中沒有資產文件夾,但在 9.0.0 版本中有我使用它并且它工作正常。


查看完整回答
反對 回復 2021-08-20
?
慕村225694

TA貢獻1880條經驗 獲得超4個贊

更改 angular.json 中的輸入配置可以將文件復制到 dist 文件夾。更改輸出配置允許找到 loader.json 文件。


查看完整回答
反對 回復 2021-08-20
  • 2 回答
  • 0 關注
  • 319 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號