Skip to content

Commit 515117d

Browse files
committed
Angular Router In Depth
1 parent 07352f9 commit 515117d

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

src/app/courses/course/course.component.ts

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
1-
import {AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, OnInit, ViewChild} from '@angular/core';
2-
import {ActivatedRoute} from '@angular/router';
1+
import { Component, OnInit} from '@angular/core';
32
import {Course} from '../model/course';
4-
import {
5-
debounceTime,
6-
distinctUntilChanged,
7-
startWith,
8-
tap,
9-
delay,
10-
map,
11-
concatMap,
12-
switchMap,
13-
withLatestFrom,
14-
concatAll, shareReplay, catchError
15-
} from 'rxjs/operators';
16-
import {merge, fromEvent, Observable, concat, throwError, combineLatest} from 'rxjs';
17-
import {CoursesService} from '../services/courses.service';
183

194

205
@Component({
@@ -26,24 +11,15 @@ export class CourseComponent implements OnInit {
2611

2712
course: Course;
2813

29-
couponCode:string;
3014

31-
32-
constructor(private route: ActivatedRoute) {
15+
constructor() {
3316

3417

3518
}
3619

3720
ngOnInit() {
3821

39-
this.course = this.route.snapshot.data["course"];
40-
41-
this.couponCode = this.route.snapshot.queryParamMap.get("couponCode");
42-
43-
}
4422

45-
confirmExit() {
46-
return confirm(`Are you sure you want to exit ${this.course.description}?`);
4723
}
4824

4925

0 commit comments

Comments
 (0)