summaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/packages/source-editor/source-editor.component.ts
diff options
context:
space:
mode:
authorahmedeldeeb50 <ahmed.eldeeb.ext@orange.com>2020-02-13 12:09:13 +0200
committerKAPIL SINGAL <ks220y@att.com>2020-02-13 20:24:36 +0000
commit0a907ab983596975d1d03507adf2b23a1ec26975 (patch)
tree75f5e85ce6e605c0308af326425e789bac6a6811 /cds-ui/designer-client/src/app/modules/feature-modules/packages/source-editor/source-editor.component.ts
parente7e6a525ed0371bf4c3b67ec6221c823b6f9617f (diff)
updating source-editor changes
Issue-ID: CCSDK-2070 Signed-off-by: ahmedeldeeb50 <ahmed.eldeeb.ext@orange.com> Change-Id: I203f89eb81ea9685ca69226b108c121a8be5f193
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.ts29
1 files changed, 17 insertions, 12 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
index a63dfa7e0..8f4c376a3 100644
--- 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
@@ -1,4 +1,5 @@
-import {AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';
+import { AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
+import { AceEditorComponent } from 'ng2-ace-editor';
// import 'brace/ext/searchbox';
// import 'ace-builds/webpack-resolver';
// import 'brace';
@@ -13,12 +14,10 @@ import {AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild
export class SourceEditorComponent implements OnInit, AfterViewInit {
- @Input() Data: string;
- @Output() DataChange = new EventEmitter();
+ @Input() text: string;
+ @Output() textChange = new EventEmitter();
@Input() lang: string;
- mode = 'json';
- @ViewChild('editor', {static: false}) editor;
- text = '';
+ @ViewChild('editor', { static: false }) editor: AceEditorComponent;
ngOnInit(): void {
// throw new Error("Method not implemented.");
@@ -26,10 +25,18 @@ export class SourceEditorComponent implements OnInit, AfterViewInit {
ngAfterViewInit() {
- this.editor.setTheme('eclipse');
+ console.log(this.lang);
+ this.editor.setTheme('eclipse');
this.editor.getEditor().setOptions({
- enableBasicAutocompletion: true
+ enableBasicAutocompletion: true,
+ // fontSize: '14pt',
+ // maxLines: 4096,
+ // behavioursEnabled: true,
+ // wrapBehavioursEnabled: true,
+ // showPrintMargin: true,
+ // indentedSoftWrap: true,
+ // wrap: true,
});
this.editor.getEditor().commands.addCommand({
@@ -41,9 +48,7 @@ export class SourceEditorComponent implements OnInit, AfterViewInit {
});
}
- onChange($event: {}) {
- console.log('editor action');
- console.log(this.Data);
- console.log($event);
+ onChange(editor) {
+ this.textChange.emit(this.text);
}
}