Angular 6 router.events.filter ‘filter’ does not exist on type ‘Observable’

This is how to filter router events with Angular 6+ and latest RxJS: import { Component, OnInit } from ‘@angular/core’; import { Router, ActivatedRoute, NavigationEnd } from ‘@angular/router’; import { filter } from ‘rxjs/operators’; export class MyComponent implements OnInit { constructor(private router: Router, private activatedRoute: ActivatedRoute) {} ngOnInit() { this.router.events.pipe( filter(event => event instanceof NavigationEnd) … Read more

Using shareReplay(1) in Angular – still invokes http request?

If you call every time this.http.get(API_ENDPOINT).pipe(shareReplay(1)), each time http request will be triggered. If you want to make http call once and cache data, the following is recommended. You first get the observable for data: ngOninit(){ this.data$ = this._jokeService.getData().pipe(shareReplay(1)); } Now subscribe multiple times: public getData(){ this.data$.subscribe(); } Your service: public getData() { return this.http.get(API_ENDPOINT) … Read more

Could not use Observable.of in RxJs 6 and Angular 6

Looks like cartant’s comment is correct, the RxJS upgrade guide doesn’t cover that method specifically but does say “Classes that operate on observables have been replaced by functions” Which seems to mean all or most of those class methods like .of, .throw etc. have been replaced by a function So instead of import { Observable, … Read more

Upgrading to Angular 10 – Fix CommonJS or AMD dependencies can cause optimization bailouts

When you use a dependency that is packaged with CommonJS, it can result in larger slower applications Starting with version 10, Angular now warns you when your build pulls in one of these bundles. If you’ve started seeing these warnings for your dependencies, let your dependency know that you’d prefer an ECMAScript module (ESM) bundle. … Read more

Angular – “has no exported member ‘Observable'”

This might be helpful in Angular 6 for more info refer this Document rxjs: Creation methods, types, schedulers and utilities import { Observable, Subject, asapScheduler, pipe, of, from, interval, merge, fromEvent } from ‘rxjs’; rxjs/operators: All pipeable operators: import { map, filter, scan } from ‘rxjs/operators’; rxjs/webSocket: The web socket subject implementation import { webSocket … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)