Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:08
    crisbeto unlabeled #44666
  • 09:08
    crisbeto labeled #44666
  • 09:06
    AleksanderBodurri synchronize #43473
  • 09:03
    crisbeto review_request_removed #44666
  • 09:03
    crisbeto review_request_removed #44666
  • 09:03
    crisbeto review_request_removed #44666
  • 08:58
    yousafnawaz commented #44738
  • 08:56
    AleksanderBodurri synchronize #43473
  • 08:52
    kemsky commented #13568
  • 08:52
    jpike88 commented #43131
  • 08:51
    jpike88 commented #43131
  • 08:50
    jpike88 commented #43131
  • 08:49
    jpike88 commented #43131
  • 08:49
    AleksanderBodurri synchronize #43473
  • 08:48
    AleksanderBodurri synchronize #43473
  • 08:47
    jpike88 commented #43131
  • 08:45
    jpike88 commented #43131
  • 08:39
    yousafnawaz synchronize #44738
  • 08:34
    13477940 starred angular/angular
  • 08:30
    AleksanderBodurri synchronize #43473
Sekib Omazic
@SekibOmazic
@robwormald Great. Thanks a lot.
Andy
@Kylia669
No provider for IterableDiffers! (NgFor -> IterableDiffers)
hey getting this issue when trying to *ngFor="#item of items"
items - simple array of objects
what is wrong?
Rob Wormald
@robwormald
is it actually an array of objects?
Abhilash
@abhibly
Hie...I'm trying create auxiliary routes in deep linked routes...but im am not getting it...I tried according to this video https://www.youtube.com/watch?v=z1NB-HG0ZH4 and didnt succeed...I have created a plunker demo...how to rectify the mistake? http://plnkr.co/edit/MVWG76rh7PDvzc3oMYgB?p=preview
Aleš
@fxck
what's that @robwormald ?
Sekib Omazic
@SekibOmazic
@fxck Answer to my questions (Observables, async pipe, template with async data,...) I'd say :-)
Aleš
@fxck
that object.assign syntax is hideous btw
Eric Martinez
@ericmartinezr
If I have a service which holds a http request to something, and I want to share its result across differents components without redoing the request, is ReplaySubject the best option? That's what I'm doing and it works perfectly, just want to be sure.
Sekib Omazic
@SekibOmazic
Well Immutable.jsisn't much prettier
@ericmartinezr I also use ReplaySubject(1) for that purpose
Eric Martinez
@ericmartinezr
Nice! I'm not the only crazy one! :P thx :D
Sekib Omazic
@SekibOmazic
You can try to decide upon http://www.introtorx.com/content/v1.0.10621.0/02_KeyTypes.html Couldn't see much difference to BehaviorSubject though
Eric Martinez
@ericmartinezr
Yup, probably BehaviorSubject would fit better since I'm passing one value, ReplaySubject can cache more than one. Thanks, I'll try that :+1:
There are so many options
Abhilash
@abhibly
Is it possible to use aux routes in a router-outlet?
JavascriptMick
@JavascriptMick
just for the dummies, does the Tour of Heroes tutorial finish at toh4? I found a toh5 but there are lots of errors in the snippets
Aleš
@fxck
I'd stay away from the tour of heroes..
it's like "look, http returns an observable, so the best thing you can do, obviously, is to wrap that in a promise, and manually handle resolve and reject"... I think it confuses people and gives them all the wrong ideas
JavascriptMick
@JavascriptMick
yea, i took the data handing with a grain of salt
pantonis
@pantonis
Im a newbie in angular2
any tutorial on asp.net and angular2?
Aleš
@fxck
if you are a newbie, then learn angular2 basics first
what backend you use after that is entirely up to you
Rob Wormald
@robwormald
@fxck ""look, http returns an observable, so the best thing you can do, obviously, is to wrap that in a promise, and manually handle resolve and reject"
where is that happening?
Aleš
@fxck
I'm probably exaggerating, but there is something similar happening, let me find it..
dunno, either can't find it(wrapping http in a promise), or it was changed already, http://stackoverflow.com/questions/34455531/angular-2-object-works-object-child-throws-error?noredirect=1#comment56653446_34455531 here's the confusion though

that guy is doing this

  getProfileData(username:string):any {
    return new Promise((resolve, reject) => {
      this._authHttp.get(API_PREFIX + '/users/username/' + username)
        .map(res => res.json())
        .subscribe(
          data => {
            resolve(data.data);
          },
          err => {
            reject(err);
          }
        )
      ;
    });

simple because he saw promises being used in the tutorial

Vlado Tesanovic
@vladotesanovic
What is the best way to detect when @Input('something') get value?
JavascriptMick
@JavascriptMick
I thought the tutorial was decent in general though and the carry on sections for dependency injection and user input were also good
Aliaksandr Astashenkau
@dfsq
@fxck so you mean it is better to return observable anyway instead of promise object?
Aleš
@fxck
this would be the way to do it
  getProfileData(username:string):any {
      this._authHttp.get(API_PREFIX + '/users/username/' + username).map(res => res.json());
  };
don't need anything else
Aliaksandr Astashenkau
@dfsq
this will return observable. but if someone wants a promise
Aleš
@fxck
the question is
why would anyone want a promise?
but if you really really wanted a promise, you could probably just do Observable.toPromise()
(not sure if that's ported to rxjs5)
Aliaksandr Astashenkau
@dfsq
well, I guess many people (including me) a little confused with new approaches with observables, so I can understand that someone would want to continue to consume good old promises
Aleš
@fxck
believe me, you don't.. the only difference between a promise and an observable, when it comes to a simple Http request
is that you do .subscribe() instead of .then()
Soroush Gholamzadeh
@s-o-r-o-u-s-h
@dfsq I also should say that Observables have very useful methods that implementing them with a promise would be a hard task, like retry()
Aliaksandr Astashenkau
@dfsq
i know all that, just saying that some people are going to be confused anyway
Aleš
@fxck
read this angular/angular#5876
Aliaksandr Astashenkau
@dfsq

but if you really really wanted a promise, you could probably just do Observable.toPromise()
(not sure if that's ported to rxjs5)

I was able to do it with PromiseObservable.create(promise); with

import {PromiseObservable} from 'rxjs/observable/fromPromise';
Aleš
@fxck
I don't understand what confuses people about observables/rxjs.. or well, I absolutely do, reactive programming is mind bending and rxjs has like 50 million operators.. but in the most simple use case, that is a simple http get request, it's all the same, just different callback function, subscribe instead of then..