Sign Up

Sign In

Forget Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask question.

Discy Latest Questions

  • 0

I’m trying to use the new HttpClient class instead of the old Http. I want to map over the data I get from the subscribe method, but get the below error. Any suggestions on why I get this? Code: export class YoutubeSearchService { ...

  • 0

I’m new to observables in angular. I have a problem wanting to return a value inside a subscribe method. I have the following method (getFirebaseData(idForm:string):observable <any[]>): getTotalQuestions(idForm:string){ let totalQuestions:number; this.getFirebaseData(idForm+"/Metadatos") .subscribe(items => { items.map(item => { ...

  • 0

I’m currently evaluating the pros ‘n’ cons of replacing Angular’s resp. RxJS’ Observable with plain Promise so that I can use async and await and get a more intuitive code style. One of our typical scenarios: Load some data within ngOnInit. Using Observables, we do: ngOnInit () { this.service.getData().subscribe(data => { ...

  • 0

i need your help, i’m trying to display some datas from my firebase but it trhows me an error like InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'. There is my service: import { Injectable } from '@angular/core'; import { AngularFireDatabase } from 'angularfire2/database';@Injectable() export class MoviesService ...

  • 0

I’m reading the Angular Guide about Routing & Navigation. They use this code for retrieving the router’s param 'id' and using it to get a hero with the service service: ngOnInit() { this.route.params .switchMap((params: Params) => this.service.getHero(+params['id'])) .subscribe((hero: Hero) ...

  • 0

Question For testing purposes, I’m creating Observable objects that replace the observable that would be returned by an actual http call with Http. My observable is created with the following code: fakeObservable = Observable.create(obs => { obs.next([1, 2, 3]); obs.complete(); }); The thing is, this observable ...

  • 0

In Angular 2 using rxjs I was trying to convert a Promise to Observable. As many of online guides showed I used fromPromise on Observable. Which throws error: Property 'fromPromise' does not exist on type 'typeof Observable'.Observable was imported like: import { Observable } from ...

  • 0

I am trying to map from a service call but getting an error. Looked at subscribe is not defined in angular 2? and it said that in order to subscribe we need to return from inside the operators. I have return statements as ...

close