Skip to content

Commit 9815891

Browse files
fix(): use pipe with rxjs observables, update courses banner
1 parent fbd5322 commit 9815891

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

src/app/app.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
22
import { Meta, Title } from '@angular/platform-browser';
33
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
4+
import { filter } from 'rxjs/operators';
45
import { HOMEPAGE_TITLE, TITLE_SUFFIX } from './constants';
56

67
@Component({
@@ -20,7 +21,7 @@ export class AppComponent implements OnInit {
2021

2122
async ngOnInit() {
2223
this.router.events
23-
.filter(ev => ev instanceof NavigationEnd)
24+
.pipe(filter((ev) => ev instanceof NavigationEnd))
2425
.subscribe((ev: NavigationEnd) => {
2526
this.updateTitle();
2627
this.updateMeta(ev);

src/app/homepage/homepage.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from '@angular/core';
1313
import { NavigationEnd, Router } from '@angular/router';
1414
import { fromEvent, Subscription } from 'rxjs';
15-
import { debounceTime } from 'rxjs/operators';
15+
import { debounceTime, filter } from 'rxjs/operators';
1616
import { environment } from '../../environments/environment';
1717
import { BasePageComponent } from './pages/page/page.component';
1818

@@ -41,7 +41,7 @@ export class HomepageComponent implements OnInit, OnDestroy, AfterViewInit {
4141

4242
ngOnInit(): void {
4343
this.router.events
44-
.filter(e => e instanceof NavigationEnd)
44+
.pipe(filter((ev) => ev instanceof NavigationEnd))
4545
.subscribe(() => {
4646
if (window.innerWidth > 768) {
4747
return false;
@@ -52,7 +52,7 @@ export class HomepageComponent implements OnInit, OnDestroy, AfterViewInit {
5252

5353
this.scrollSubscription = fromEvent(window, 'scroll')
5454
.pipe(debounceTime(this.scrollDebounceTime))
55-
.subscribe(_ => {
55+
.subscribe((_) => {
5656
this.checkViewportBoundaries();
5757
});
5858
}

src/app/homepage/menu/menu.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
OnInit,
66
} from '@angular/core';
77
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
8+
import { filter } from 'rxjs/operators';
89

910
@Component({
1011
selector: 'app-menu',
@@ -254,7 +255,7 @@ export class MenuComponent implements OnInit {
254255

255256
ngOnInit() {
256257
this.router.events
257-
.filter((event) => event instanceof NavigationEnd)
258+
.pipe(filter((ev) => ev instanceof NavigationEnd))
258259
.subscribe((event) => this.toggleCategory());
259260

260261
this.toggleCategory();

src/app/shared/components/banner-courses/banner-courses.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<h2>Learn the <span>right</span> way!</h2>
33
<ul>
44
<li>
5-
<span><i class="fas fa-check"></i></span> 60+ chapters
5+
<span><i class="fas fa-check"></i></span> 80+ chapters
66
</li>
77
<li>
8-
<span><i class="fas fa-check"></i></span> 4+ hours of videos
8+
<span><i class="fas fa-check"></i></span> 5+ hours of videos
99
</li>
1010
<li>
1111
<span><i class="fas fa-check"></i></span> Official certificate

0 commit comments

Comments
 (0)