summaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/packages/source-editor/source-editor.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/source-editor/source-editor.component.ts')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/source-editor/source-editor.component.ts44
1 files changed, 44 insertions, 0 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/source-editor/source-editor.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/source-editor/source-editor.component.ts
new file mode 100644
index 000000000..9c3435d98
--- /dev/null
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/source-editor/source-editor.component.ts
@@ -0,0 +1,44 @@
+import { Component, OnInit, ViewChild, Input, AfterViewInit } from '@angular/core';
+// import 'brace/ext/searchbox';
+// import 'ace-builds/webpack-resolver';
+// import 'brace';
+// import 'brace/ext/language_tools';
+// import 'ace-builds/src-min-noconflict/snippets/html';
+
+@Component({
+ selector: 'app-source-editor',
+ templateUrl: './source-editor.component.html',
+ styleUrls: ['./source-editor.component.css']
+})
+export class SourceEditorComponent implements OnInit, AfterViewInit {
+
+
+ @Input() Data: string;
+ @Input() lang: string;
+ mode = 'json';
+ @ViewChild('editor', { static: false }) editor;
+ text = '';
+
+ ngOnInit(): void {
+ // throw new Error("Method not implemented.");
+ }
+
+
+
+ ngAfterViewInit() {
+ this.editor.setTheme('eclipse');
+
+ this.editor.getEditor().setOptions({
+ enableBasicAutocompletion: true
+ });
+
+ this.editor.getEditor().commands.addCommand({
+ name: 'showOtherCompletions',
+ bindKey: 'Ctrl-.',
+ exec(editor) {
+
+ }
+ });
+ }
+
+}