Skip to content

Commit 8480dd0

Browse files
authored
Merge pull request #169 from raj-rathod/rajesh
feat:<change layout of interview questions>
2 parents 76907b5 + 3f3a4f5 commit 8480dd0

8 files changed

+12
-77
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
.question-conationer{
2-
min-height: 500px;
3-
max-height: 500px;
4-
overflow-x: hidden;
5-
overflow-y: auto;
6-
padding-right: 10px;
7-
}
1+
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
<app-breadcrumbs [selectedRoute]="currentQuestion-1" [routersData]="routesData"></app-breadcrumbs>
2-
<div class="chip mb-2">
3-
{{currentQuestion}}/{{totalQuestion}}
4-
</div>
5-
<div class="question-conationer" [innerHTML]="question"></div>
6-
<app-previous-next-route [selectedRoute]="currentQuestion-1" [routersData]="routesData"></app-previous-next-route>
1+
<div class="question-conationer" *ngFor="let question of questions" [innerHTML]="question.answer"></div>

src/app/components/Interview/angular/angular-questions/angular-questions.component.ts

+2-24
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,13 @@ import { HighlightService } from 'src/app/shared/services/highlight-syntax.servi
1111
})
1212
export class AngularQuestionsComponent implements OnInit, AfterViewInit, AfterViewChecked {
1313
questions = angularInterviewQuestion;
14-
slug:string = '';
15-
totalQuestion = 0;
16-
currentQuestion = 0;
17-
routesData = Helper.setAllInterviewQuestionRoute('/interview-questions/angular/', this.questions);
18-
question = this.questions[0].answer;
1914
constructor(
2015
private highLightCode: HighlightService,
21-
private route: ActivatedRoute,
22-
private router: Router,
16+
2317
) { }
2418

2519
ngOnInit(): void {
26-
this.totalQuestion = this.questions.length;
27-
this.route.paramMap.subscribe((params: ParamMap) => {
28-
if(params.get('slug')){
29-
this.slug = params.get('slug')!
30-
}else{
31-
this.slug = this.questions[0].slug;
32-
this.router.navigate([`/interview-questions/angular/${this.slug}`]);
33-
}
34-
const index = this.questions.findIndex(question => question.slug === this.slug);
35-
if(index>-1){
36-
this.question = this.questions[index].answer
37-
this.currentQuestion = index+1;
38-
}else{
39-
this.router.navigate([`**`]);
40-
}
41-
42-
})
20+
4321
}
4422

4523
ngAfterViewInit(): void {
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
.question-conationer{
2-
min-height: 500px;
3-
max-height: 500px;
4-
overflow-x: hidden;
5-
overflow-y: auto;
6-
padding-right: 10px;
7-
}
1+
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
<app-breadcrumbs [selectedRoute]="currentQuestion-1" [routersData]="routesData"></app-breadcrumbs>
2-
<div class="chip mb-2">
3-
{{currentQuestion}}/{{totalQuestion}}
4-
</div>
5-
<div class="question-conationer" [innerHTML]="question"></div>
6-
<app-previous-next-route [selectedRoute]="currentQuestion-1" [routersData]="routesData"></app-previous-next-route>
1+
<div class="question-conationer" *ngFor="let question of questions" [innerHTML]="question.answer"></div>

src/app/components/Interview/javascript/javascript-questions/javascript-questions.component.ts

+2-24
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,13 @@ import { HighlightService } from 'src/app/shared/services/highlight-syntax.servi
1111
})
1212
export class JavascriptQuestionsComponent implements OnInit {
1313
questions = javascriptInterviewQuestion;
14-
slug:string = '';
15-
totalQuestion = 0;
16-
currentQuestion = 0;
17-
routesData = Helper.setAllInterviewQuestionRoute('/interview-questions/javascript/', this.questions);
18-
question = this.questions[0].answer;
14+
1915
constructor(
2016
private highLightCode: HighlightService,
21-
private route: ActivatedRoute,
22-
private router: Router,
17+
2318
) { }
2419

2520
ngOnInit(): void {
26-
this.totalQuestion = this.questions.length;
27-
this.route.paramMap.subscribe((params: ParamMap) => {
28-
if(params.get('slug')){
29-
this.slug = params.get('slug')!
30-
}else{
31-
this.slug = this.questions[0].slug;
32-
this.router.navigate([`/interview-questions/javascript/${this.slug}`]);
33-
}
34-
const index = this.questions.findIndex(question => question.slug === this.slug);
35-
if(index>-1){
36-
this.question = this.questions[index].answer
37-
this.currentQuestion = index+1;
38-
}else{
39-
this.router.navigate([`**`]);
40-
}
41-
42-
})
4321
}
4422

4523
ngAfterViewInit(): void {

src/app/components/Interview/javascript/javascript-routing.module.ts

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import { JavascriptQuestionsComponent } from './javascript-questions/javascript-
55
const routes: Routes = [
66
{
77
path:'', component: JavascriptQuestionsComponent
8-
},
9-
{
10-
path:':slug', component: JavascriptQuestionsComponent
118
}
129
];
1310

src/styles.css

+4
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,10 @@ li {
468468
font-weight: 500;
469469
}
470470

471+
.question-conationer{
472+
padding-bottom: 16px !important;
473+
}
474+
471475
@media(max-width:992px) {
472476
.cdk-overlay-pane {
473477
width: 45%;

0 commit comments

Comments
 (0)