hisptz/integration-app

View on GitHub
src/app/pages/integration/components/editor/editor.component.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';

@Component({
  selector: 'app-editor',
  templateUrl: './editor.component.html',
  styleUrls: ['./editor.component.css']
})
export class EditorComponent implements OnInit {
  @Input() code: string;
  editorOptions: any;

  @Output() codeUpdate: EventEmitter<string> = new EventEmitter<string>();
  constructor() {}

  ngOnInit() {
    this.editorOptions = { theme: 'vs-dark', language: 'javascript' };
  }

  onCodeUpdate(code: string) {
    this.codeUpdate.emit(code);
  }
}