Skip to content

Commit 76907b5

Browse files
authored
Merge pull request #168 from raj-rathod/rajesh
Rajesh
2 parents ef2d3eb + 0d4341c commit 76907b5

16 files changed

+2667
-2
lines changed

src/app/app-routing.module.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { HomeComponent } from './layout/home/home.component';
66
import { PageNotFoundComponent } from './layout/page-not-found/page-not-found.component';
77
import { DsaMainComponent } from './layout/dsa-main/dsa-main.component';
88
import { InterviewQuestionComponent } from './layout/interview-question/interview-question.component';
9+
import { ProblemSolvingComponent } from './layout/problem-solving/problem-solving.component';
910

1011
const routes: Routes = [
1112
{
@@ -64,6 +65,18 @@ const routes: Routes = [
6465
}
6566
]
6667
},
68+
{
69+
path:'problem-solving-trick',
70+
component: ProblemSolvingComponent,
71+
children:[
72+
{
73+
path:'',
74+
loadChildren: () => import('./components/problem-solving/problem-solving.module').then(
75+
(m) => m.ProblemSolvingModule
76+
)
77+
},
78+
]
79+
},
6780
{
6881
path: '**',
6982
component: PageNotFoundComponent,

src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { ServiceWorkerModule } from '@angular/service-worker';
1515
import { environment } from '../environments/environment';
1616
import { DsaMainComponent } from './layout/dsa-main/dsa-main.component';
1717
import { InterviewQuestionComponent } from './layout/interview-question/interview-question.component';
18+
import { ProblemSolvingComponent } from './layout/problem-solving/problem-solving.component';
1819

1920

2021
@NgModule({
@@ -28,6 +29,7 @@ import { InterviewQuestionComponent } from './layout/interview-question/intervie
2829
PageNotFoundComponent,
2930
DsaMainComponent,
3031
InterviewQuestionComponent,
32+
ProblemSolvingComponent,
3133
],
3234
imports: [
3335
FormsModule,
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { NgModule } from '@angular/core';
2+
import { RouterModule, Routes } from '@angular/router';
3+
import { StringProblemComponent } from './string-problem/string-problem.component';
4+
5+
const routes: Routes = [
6+
{
7+
path:'', pathMatch:'full', redirectTo:'string'
8+
},
9+
{
10+
path:'string', component: StringProblemComponent
11+
}
12+
];
13+
14+
@NgModule({
15+
imports: [RouterModule.forChild(routes)],
16+
exports: [RouterModule]
17+
})
18+
export class ProblemSolvingRoutingModule { }
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
4+
import { ProblemSolvingRoutingModule } from './problem-solving-routing.module';
5+
import { StringProblemComponent } from './string-problem/string-problem.component';
6+
7+
8+
@NgModule({
9+
declarations: [
10+
StringProblemComponent
11+
],
12+
imports: [
13+
CommonModule,
14+
ProblemSolvingRoutingModule
15+
]
16+
})
17+
export class ProblemSolvingModule { }

src/app/components/problem-solving/string-problem/string-problem.component.css

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div [innerHTML]="stringTips"></div>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { StringProblemComponent } from './string-problem.component';
4+
5+
describe('StringProblemComponent', () => {
6+
let component: StringProblemComponent;
7+
let fixture: ComponentFixture<StringProblemComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
declarations: [ StringProblemComponent ]
12+
})
13+
.compileComponents();
14+
});
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(StringProblemComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { AfterViewInit, Component, OnInit } from '@angular/core';
2+
import { StringTips } from 'src/app/core/problem-solving/string';
3+
import { HighlightService } from 'src/app/shared/services/highlight-syntax.service';
4+
5+
@Component({
6+
selector: 'app-string-problem',
7+
templateUrl: './string-problem.component.html',
8+
styleUrls: ['./string-problem.component.css']
9+
})
10+
export class StringProblemComponent implements OnInit, AfterViewInit {
11+
stringTips = StringTips
12+
constructor(
13+
private highLightCode: HighlightService,
14+
) { }
15+
16+
ngOnInit(): void {
17+
}
18+
19+
ngAfterViewInit(): void {
20+
this.highLightCode.highlightAll();
21+
}
22+
23+
}

0 commit comments

Comments
 (0)