Hacker News new | past | comments | ask | show | jobs | submit login

Not sure if this helps, but trying to learn Angular2 I wrote a weather app with it using RC5. It is not the cleanest and I never used Angular 1 so I can't do a comparison.

https://github.com/mattsmithdev/weathercard.angular2




you can refactor those nested observables using mergeMap:

  this._settingsService.settings$.mergeMap(settings => {
  
          this.settings = settings;
          return this._weatherService.getLatestWeather(this._location, settings);
      })
      .subscribe(
          weather => this.weather = weather,
          error => this.errorMessage = <any>error
      );


Thanks. Learning observables was definitely a little challenging, so I appreciate the insight.


Thanks you for sharing such a beautiful weather app.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: