Ace editor integration with TypeScript for Angular 10.
npm install @postfinance/ngx-ace-editor-wrapperAce editor integration with TypeScript for Angular 10.


- Examples
- Installation
- Usage
- Hat Tips
- License
There is a live example available on GitHub Pages.
npm i @postfinance/ngx-ace-editor-wrapper
``ts
import { AceEditorModule } from '@postfinance/ngx-ace-editor-wrapper';
@NgModule({
...
imports: [
...
AceEditorModule
]
})
`
> Minimal
`ts
// import { AceEditorModule } from '@postfinance/ngx-ace-editor-wrapper';
import { Component } from '@angular/core'
@Component({
template:
,
})
export class MyComponent {
text: string = ''
}
`> Complete
`ts
import { Component } from '@angular/core'// Imports are important! You may configure it via
angular.json as well.
import 'brace'
import 'brace/mode/sql'
import 'brace/theme/eclipse'@Component({
template:
,
})
export class MyComponent {
text: string = ''
options: any = { maxLines: 1000, printMargin: false } onChange(code) {
console.log('new code', code)
}
}
`$3
`ts
import { Component, ViewChild } from '@angular/core'import { AceEditorComponent } from '@postfinance/ngx-ace-editor-wrapper'
// Imports are important!
import 'brace'
@Component({
template:
,
})
export class AceCmp {
@ViewChild(AceEditorComponent)
editor text: string = ''
ngAfterViewInit() {
this.editor.setTheme('eclipse')
this.editor.getEditor().setOptions({
enableBasicAutocompletion: true,
})
this.editor.getEditor().commands.addCommand({
name: 'showOtherCompletions',
bindKey: 'Ctrl-.',
exec: function (editor) {},
})
}
}
`Hat Tips
- To Andrei Tumilovich for the original Angular 9 integration:
tavwizard/ace-editor-ng9
- To Timon Borter for the Angular 10 migration: bbortt/ngx-ace-editor-wrapper`This project is licensed under the terms of the Apache 2.0 License.