Add fileName property to models and update related components for file handling
This commit is contained in:
+1
-1
@@ -70,7 +70,7 @@
|
||||
<mat-divider></mat-divider>
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Markdown text | Result">
|
||||
<textarea class="variable-textarea" [(ngModel)]="markdown"></textarea>
|
||||
<textarea class="variable-textarea" [(ngModel)]="tutorial.body"></textarea>
|
||||
<markdown class="variable-binding" [data]="tutorial.body"></markdown>
|
||||
</mat-tab>
|
||||
<mat-tab label="Editor">
|
||||
|
||||
+5
-5
@@ -70,7 +70,7 @@ const language = 'typescript';
|
||||
|
||||
### Blockquote
|
||||
> Blockquote to the max`;
|
||||
private id: string | null | undefined;
|
||||
private fileName: string | null | undefined;
|
||||
|
||||
constructor(private userApiService: UserApiService,
|
||||
private route: ActivatedRoute,
|
||||
@@ -81,11 +81,11 @@ const language = 'typescript';
|
||||
this.route.queryParams
|
||||
.subscribe(params => {
|
||||
console.log(params);
|
||||
this.id = params['id'];
|
||||
console.log(this.id);
|
||||
this.fileName = params['fileName'];
|
||||
console.log(this.fileName);
|
||||
});
|
||||
|
||||
this.userApiService.getTutorial(this.id).subscribe(
|
||||
this.userApiService.getTutorial(this.fileName).subscribe(
|
||||
data=>{
|
||||
this.tutorial = data;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ const language = 'typescript';
|
||||
}
|
||||
|
||||
updateTutorial(): void {
|
||||
this.userApiService.update(this.id, this.tutorial)
|
||||
this.userApiService.update(this.fileName, this.tutorial)
|
||||
.subscribe(
|
||||
response => {
|
||||
console.log(response);
|
||||
|
||||
Reference in New Issue
Block a user