diff --git a/src/app/app.component.css b/src/app/app.component.css index 8827624..88a4c52 100644 --- a/src/app/app.component.css +++ b/src/app/app.component.css @@ -59,4 +59,15 @@ iframe{ } .no-border-bottom{ border-bottom: none; +} +.console ul{ + padding:0px; + margin: 0px; + list-style-type: none; +} +.console ul li{ + border-top:1px solid #eee; +} +.console ul li.log{ + color:#111; } \ No newline at end of file diff --git a/src/app/app.component.html b/src/app/app.component.html index 7565e77..abfca3b 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,7 +1,7 @@
- +
@@ -50,8 +50,8 @@
    -
  • - {{log}} +
  • + {{log.text}}
\ No newline at end of file diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 78b85ad..ad31e1e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -31,7 +31,10 @@ export class AppComponent implements AfterViewInit{ overrideConsole(){ this.iframe.nativeElement.contentWindow.console.log = (log:any)=>{ - this.logs.push(log); + this.logs.push({ + "text":log, + "type":"log" + }); } } diff --git a/src/app/editor/editor.component.html b/src/app/editor/editor.component.html index 1c0733b..ff68941 100644 --- a/src/app/editor/editor.component.html +++ b/src/app/editor/editor.component.html @@ -1,6 +1,7 @@ +[mode]=mode +[options]="options"> \ No newline at end of file diff --git a/src/app/editor/editor.component.ts b/src/app/editor/editor.component.ts index c5371a0..c529f02 100644 --- a/src/app/editor/editor.component.ts +++ b/src/app/editor/editor.component.ts @@ -1,18 +1,22 @@ import { Component, OnInit, EventEmitter } from '@angular/core'; -import { Input,Output } from '@angular/core'; +import { Input,Output, AfterViewInit } from '@angular/core'; @Component({ selector: 'app-editor', templateUrl: './editor.component.html', styleUrls: ['./editor.component.css'] }) -export class EditorComponent implements OnInit { +export class EditorComponent implements OnInit,AfterViewInit { @Output('contentChange') contentEvent:EventEmitter = new EventEmitter(); @Input('mode') mode:any; @Input('content') content:any; + options:any = {}; - constructor() { } + + ngAfterViewInit() { + this.options.enableBasicAutocompletion = true; + } ngOnInit() { }