mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-06-28 21:35:12 +00:00
Create initial version of application
This commit is contained in:
9
src/app/webide/webide.component.html
Normal file
9
src/app/webide/webide.component.html
Normal file
@ -0,0 +1,9 @@
|
||||
<div
|
||||
ace-editor
|
||||
[(text)]="code"
|
||||
[mode]="language"
|
||||
[theme]="theme"
|
||||
style="min-height: 200px; width:100%; overflow: auto;"
|
||||
>
|
||||
|
||||
</div>
|
0
src/app/webide/webide.component.scss
Normal file
0
src/app/webide/webide.component.scss
Normal file
25
src/app/webide/webide.component.spec.ts
Normal file
25
src/app/webide/webide.component.spec.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { WebideComponent } from './webide.component';
|
||||
|
||||
describe('WebideComponent', () => {
|
||||
let component: WebideComponent;
|
||||
let fixture: ComponentFixture<WebideComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ WebideComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(WebideComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
25
src/app/webide/webide.component.ts
Normal file
25
src/app/webide/webide.component.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
import 'brace/mode/python';
|
||||
import 'brace/theme/monokai';
|
||||
|
||||
const defaultSourceCode =
|
||||
`def hello():
|
||||
print('Hello world!')`;
|
||||
|
||||
@Component({
|
||||
selector: 'app-webide',
|
||||
templateUrl: './webide.component.html',
|
||||
styleUrls: ['./webide.component.scss']
|
||||
})
|
||||
export class WebideComponent implements OnInit {
|
||||
code: string = defaultSourceCode;
|
||||
language = 'python';
|
||||
theme = 'monokai';
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user