9c3435d98aa4d722646abd2436b1f9bdfd3ae33a
[ccsdk/cds.git] /
1 import { Component, OnInit, ViewChild, Input, AfterViewInit } from '@angular/core';
2 // import 'brace/ext/searchbox';
3 // import 'ace-builds/webpack-resolver';
4 // import 'brace';
5 // import 'brace/ext/language_tools';
6 // import 'ace-builds/src-min-noconflict/snippets/html';
7
8 @Component({
9   selector: 'app-source-editor',
10   templateUrl: './source-editor.component.html',
11   styleUrls: ['./source-editor.component.css']
12 })
13 export class SourceEditorComponent implements OnInit, AfterViewInit {
14
15
16   @Input() Data: string;
17   @Input() lang: string;
18   mode = 'json';
19   @ViewChild('editor', { static: false }) editor;
20   text = '';
21
22   ngOnInit(): void {
23     //  throw new Error("Method not implemented.");
24   }
25
26
27
28   ngAfterViewInit() {
29     this.editor.setTheme('eclipse');
30
31     this.editor.getEditor().setOptions({
32       enableBasicAutocompletion: true
33     });
34
35     this.editor.getEditor().commands.addCommand({
36       name: 'showOtherCompletions',
37       bindKey: 'Ctrl-.',
38       exec(editor) {
39
40       }
41     });
42   }
43
44 }