Initial commit
This commit is contained in:
15
src/app/input-output/input-output.component.html
Normal file
15
src/app/input-output/input-output.component.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<main>
|
||||
<section id="left">
|
||||
<h3>Input</h3>
|
||||
<ngx-monaco-editor (ngModelChange)="handleInputChange($event)"
|
||||
[options]="inputOptions"
|
||||
[(ngModel)]="input">
|
||||
</ngx-monaco-editor>
|
||||
</section>
|
||||
<section id="right">
|
||||
<h3>Output</h3>
|
||||
<ngx-monaco-editor [options]="outputOptions"
|
||||
[(ngModel)]="output">
|
||||
</ngx-monaco-editor>
|
||||
</section>
|
||||
</main>
|
||||
19
src/app/input-output/input-output.component.scss
Normal file
19
src/app/input-output/input-output.component.scss
Normal file
@@ -0,0 +1,19 @@
|
||||
main {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
#left {
|
||||
flex: 0.5;
|
||||
}
|
||||
|
||||
#right {
|
||||
flex: 0.5;
|
||||
}
|
||||
|
||||
ngx-monaco-editor {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
23
src/app/input-output/input-output.component.spec.ts
Normal file
23
src/app/input-output/input-output.component.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { InputOutputComponent } from './input-output.component';
|
||||
|
||||
describe('InputOutputComponent', () => {
|
||||
let component: InputOutputComponent;
|
||||
let fixture: ComponentFixture<InputOutputComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [InputOutputComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(InputOutputComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
25
src/app/input-output/input-output.component.ts
Normal file
25
src/app/input-output/input-output.component.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
||||
import {EditorComponent} from "ngx-monaco-editor-v2";
|
||||
import {FormsModule} from "@angular/forms";
|
||||
|
||||
@Component({
|
||||
selector: 'app-input-output',
|
||||
standalone: true,
|
||||
imports: [
|
||||
EditorComponent,
|
||||
FormsModule
|
||||
],
|
||||
templateUrl: './input-output.component.html',
|
||||
styleUrl: './input-output.component.scss'
|
||||
})
|
||||
export class InputOutputComponent {
|
||||
@Input() input!: string;
|
||||
@Input() inputOptions!: any;
|
||||
@Output() onInputChange = new EventEmitter();
|
||||
@Input() output!: string;
|
||||
@Input() outputOptions!: any;
|
||||
|
||||
handleInputChange($event: string) {
|
||||
this.onInputChange.emit($event);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user