File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
frontend/src/app/questions Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ <h3 class="m-0">Manage Questions</h3>
78
78
< p-dialog header ="Header " [(visible)] ="isDialogVisible " [modal] ="true " [style] ="{ width: '25rem' } ">
79
79
< ng-template pTemplate ="header ">
80
80
< div class ="inline-flex align-items-center justify-content-center gap-2 ">
81
- < span class ="font-bold white-space-nowrap "> Create new question </ span >
81
+ < span class ="font-bold white-space-nowrap "> {{ dialogHeader }} </ span >
82
82
</ div >
83
83
</ ng-template >
84
84
Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ export class QuestionsComponent implements OnInit {
67
67
68
68
cols : Column [ ] = [ ] ;
69
69
70
+ dialogHeader = '' ;
71
+
70
72
constructor (
71
73
private questionService : QuestionService ,
72
74
private messageService : MessageService ,
@@ -83,8 +85,6 @@ export class QuestionsComponent implements OnInit {
83
85
this . initDifficulties ( ) ;
84
86
85
87
this . initFormGroup ( ) ;
86
-
87
- // this.initListeners();
88
88
}
89
89
90
90
get isTitleInvalid ( ) : boolean {
@@ -108,6 +108,7 @@ export class QuestionsComponent implements OnInit {
108
108
}
109
109
110
110
openNewQuestion ( ) {
111
+ this . dialogHeader = 'Create new question' ;
111
112
this . resetFormGroup ( ) ;
112
113
this . question = { } as Question ;
113
114
this . submitted = false ;
@@ -154,6 +155,7 @@ export class QuestionsComponent implements OnInit {
154
155
}
155
156
156
157
editQuestion ( question : Question ) {
158
+ this . dialogHeader = 'Edit Question' ;
157
159
this . question . id = question . id ;
158
160
this . questionFormGroup . patchValue ( {
159
161
title : question . title ,
You can’t perform that action at this time.
0 commit comments