1 import {AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';
2 // import 'brace/ext/searchbox';
3 // import 'ace-builds/webpack-resolver';
5 // import 'brace/ext/language_tools';
6 // import 'ace-builds/src-min-noconflict/snippets/html';
9 selector: 'app-source-editor',
10 templateUrl: './source-editor.component.html',
11 styleUrls: ['./source-editor.component.css']
13 export class SourceEditorComponent implements OnInit, AfterViewInit {
16 @Input() Data: string;
17 @Output() DataChange = new EventEmitter();
18 @Input() lang: string;
20 @ViewChild('editor', {static: false}) editor;
24 // throw new Error("Method not implemented.");
29 this.editor.setTheme('eclipse');
31 this.editor.getEditor().setOptions({
32 enableBasicAutocompletion: true
35 this.editor.getEditor().commands.addCommand({
36 name: 'showOtherCompletions',
44 onChange($event: {}) {
45 console.log('editor action');
46 console.log(this.Data);