ng2-ace-editor
Ace editor integration with typescript for angular 2.
Install
npm i -S ng2-ace-editor
Use directive
Minimal
//add "AceEditorDirective" to your modules list ; @ text:string = "";
Complete
//add "AceEditorDirective" to your modules list//import { AceEditorDirective } from 'ng2-ace-editor'; ; //to use theme "eclipse"//with angular-cli add "../node_modules/ace-builds/src-min/ace.js" //and "../node_modules/ace-builds/src-min/theme-eclipse.js" to "scripts" var into the file angular-cli.json @ text:string = ""; options:any = maxLines: 1000 printMargin: false; { console; }
Use Component
//add "AceEditorComponent" to your modules list//import { AceEditorComponent } from 'ng2-ace-editor'; ; //to use theme eclipse//with angular-cli add "../node_modules/ace-builds/src-min/ace.js" //and "../node_modules/ace-builds/src-min/theme-eclipse.js" to "scripts" var into the file angular-cli.json @ @ editor; text: string = ""; { thiseditor; thiseditor; thiseditorcommands }
Use AOT (thx Geschan)
// other imports; @