mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-16 02:41:56 +00:00
Implement feedback for "save" button
This commit is contained in:
parent
5ed4c0b428
commit
9030df0a2b
@ -3,4 +3,5 @@ export class SourceCode {
|
||||
content: string;
|
||||
language: string;
|
||||
files: string[];
|
||||
saved: boolean;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div
|
||||
<div (textChanged)="saved = false"
|
||||
ace-editor
|
||||
[(text)]="code"
|
||||
[(mode)]="language"
|
||||
@ -16,4 +16,8 @@
|
||||
>
|
||||
</div>
|
||||
|
||||
<button (click)="sendCode()" type="submit" class="btn btn-secondary">Save</button>
|
||||
<button (click)="sendCode()"
|
||||
type="submit"
|
||||
class="btn btn-secondary"
|
||||
[class.btn-success]="saved === true"
|
||||
>Save<span *ngIf="saved === true">d!</span></button>
|
||||
|
@ -20,6 +20,7 @@ export class WebideComponent implements OnInit {
|
||||
language = 'javascript';
|
||||
theme = 'monokai';
|
||||
files: string[];
|
||||
saved = false;
|
||||
|
||||
constructor(private webSocketService: WebSocketService) { }
|
||||
|
||||
@ -29,6 +30,7 @@ export class WebideComponent implements OnInit {
|
||||
this.code = event.data.content;
|
||||
this.language = event.data.language;
|
||||
this.files = event.data.files;
|
||||
this.saved = event.data.saved;
|
||||
});
|
||||
this.requestCode();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user