mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-16 05:51:55 +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;
|
content: string;
|
||||||
language: string;
|
language: string;
|
||||||
files: string[];
|
files: string[];
|
||||||
|
saved: boolean;
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div (textChanged)="saved = false"
|
||||||
ace-editor
|
ace-editor
|
||||||
[(text)]="code"
|
[(text)]="code"
|
||||||
[(mode)]="language"
|
[(mode)]="language"
|
||||||
@ -16,4 +16,8 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</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';
|
language = 'javascript';
|
||||||
theme = 'monokai';
|
theme = 'monokai';
|
||||||
files: string[];
|
files: string[];
|
||||||
|
saved = false;
|
||||||
|
|
||||||
constructor(private webSocketService: WebSocketService) { }
|
constructor(private webSocketService: WebSocketService) { }
|
||||||
|
|
||||||
@ -29,6 +30,7 @@ export class WebideComponent implements OnInit {
|
|||||||
this.code = event.data.content;
|
this.code = event.data.content;
|
||||||
this.language = event.data.language;
|
this.language = event.data.language;
|
||||||
this.files = event.data.files;
|
this.files = event.data.files;
|
||||||
|
this.saved = event.data.saved;
|
||||||
});
|
});
|
||||||
this.requestCode();
|
this.requestCode();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user