在使用插件ngx-monaco-editor时踩到的坑,由于需要插入的suggestion类型为Function,并且需要在选择后自动将光标定位在括号内,官方github中文档链接一直失效(不知道是网络原因还是已经失效) 首先挂上目前可以正常访问的官网文档地址: https://microsoft.github.io/monaco-editor/ 如果对于官方文档的使用不太熟悉可以搜索这篇...
import{Component}from'@angular/core';import{DiffEditorModel}from'ngx-monaco-editor';@Component({selector:'app-root',templateUrl:'./app.component.html'})exportclassAppComponent{options={theme:'vs-dark'};originalModel:DiffEditorModel={code:'heLLo world!',language:'text/plain'};modifiedModel:DiffE...
http://localhost:4200/assets/monaco/vs/loader.jsnet::ERR_ABORTED 404(未找到)@base-editor.js:65 loader.js 文件位于 node_modules/ngx-monaco-editor/assets/monaco/vs/loader.js,我可以导航到它。 错误发生在 base-editor.js,第 65 行。此文件的位置是 node_modules/ngx-monaco-editor/base-editor.js...
终于解决了!是baseUrl引起的,需要将/assets/monaco-editor/min/vs改为/assets
{ NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; import { MonacoEditorModule } from 'ngx-monaco-editor'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, FormsModule, MonacoEditorModule...
npm install monaco-editor @materia-ui/ngx-monaco-editor --save Add the glob to assets in angular.json (to make monaco-editor lib available to the app): {..."projects":{"YOUR_APP_NAME":{..."architect":{"build":{..."options":{..."assets":[{"glob":"**/*","input":"node_mod...
Monaco Code Editor for Angular angular monaco monaco-editor code ngx-monaco-editor jeanmerelispublished 18.0.2 • 4 months agopublished 18.0.2 4 months ago M Q PFooter Support Help Advisories Status Contact npm Company About Blog Press Terms & Policies Policies Terms of Use Code of Conduct ...
onInit(editor: any) {this._editor= editor;this.enableShortcuts(); }enableShortcuts() {this._editor.addAction({id:"clearQuery",label:"Clear Current Query",keybindings: [(windowasany).monaco.KeyMod.CtrlCmd| (windowasany).monaco.KeyCode.KeyL],contextMenuGroupId:"3_...
I followed the directions, and no matter what when i compile, angular always throws the error: "'ngx-monaco-editor' is not a known element:". I've tried multiple ways to import it and different libraries and ways to reference it but there seems to be disconnect. Currently I have it se...
1.首先在确认js.css等东西有导入,和之前的网页也没有什么区别 2.网上查询之后, 解释:有些时候...