diff --git a/src/app/webide/webide.component.ts b/src/app/webide/webide.component.ts index d3bd3c1..b22d119 100644 --- a/src/app/webide/webide.component.ts +++ b/src/app/webide/webide.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; import 'brace/mode/python'; import 'brace/mode/javascript'; @@ -22,7 +22,8 @@ export class WebideComponent implements OnInit { files: string[]; saveButtonState = 'DIRTY'; - constructor(private webSocketService: WebSocketService) { } + constructor(private webSocketService: WebSocketService, + private changeDetectorRef: ChangeDetectorRef) { } ngOnInit() { this.webSocketService.observeAnchor(this.anchor_id).subscribe((event) => { @@ -33,6 +34,8 @@ export class WebideComponent implements OnInit { if (event.data.command === 'write') { this.saveButtonState = 'SAVED'; } if (event.data.command === 'reload') { this.requestCode(); } + + this.changeDetectorRef.detectChanges(); }); this.requestCode(); }