How to compose reducers with dependent state · Issue #19 · ngrx/store · GitHub

  • We wonder whether you agree with us that the computed streams should also be members of the store.
  • select ( ‘ widgets ‘ ); let selection$ = store .
  • CombineLatest ( widgets$ , selection$ , ( widgets , selection ) => { // do something and return the “calculated” state return computeSelectedWidgets ( widgets , selection ); });
  • ); } // optionally add an action : selectWidget( widget ){ this .
  • select ( ‘ selection ‘ ); // selectedWidgets will be recalculated when either foos$ or bars$ emits a new value let selectedWidgets$ = Observable .

store – RxJS powered state management for Angular applications, inspired by Redux
Continue reading “How to compose reducers with dependent state · Issue #19 · ngrx/store · GitHub”

Angular 2 Gotchas and Interview Questions

  • Creating a Container Component in Angular 2 [Code Snippet]
  • It takes some time and hands-on experience to realize that both systems can, and should, be used in harmony to create a well designed Angular 2 application.
  • I have a strong feeling that most production issues for Angular 2 applications will have root cause related to Dependency Injection.
  • Even with the small application, it started to get annoying quickly having to declare every component, pipe, directive etc in modules.
  • If we look at a component, we are basically embedding HTML in Typescript code from a developer’s perspective.

No framework is perfect, and Angular 2 is not exempt from that. Let’s look at some of its pitfalls and even get you prepped for your next interview. After reading, you’ll be Angular 2 ready.
Continue reading “Angular 2 Gotchas and Interview Questions”

Does Angular 2 live up to the hype?

  • One of the big things you’ll notice about Angular 2 is that they really push you to use TypeScript.
  • TypeScript and Angular 2 push you towards designs that are easier to implement and understand than their Angular 1 counterparts.
  • After you’ve built your new Angular 2 app, you can use the Git Tool to deploy it to the Cycligent Cloud.
  • And if you’re using TypeScript, missing dependencies will become compile errors.
  • TypeScript required a compile step so we tried to avoid it for a long time.

As we watch Angular 2’s first production release version roll-out, many of us are asking ourselves these questions: Who do I believe? Just what is in Angular 2? Is it really that much better than Angular 1? Do I upgrade now or do I continue on with my existing framework, especially if that is Angular 1?
Continue reading “Does Angular 2 live up to the hype?”


  • import { Injectable } from ‘ @angular/core ‘ ; import { Action } from ‘ @ngrx/store ‘ ; import { ActionCreatorFactory } from ‘ ngrx-action-creator-factory ‘ ; @ Injectable () export class NowPlaylistActions { static MEDIA_ENDED = ‘ [NOW PLAYLIST] MEDIA_ENDED ‘ ; static QUEUE = ‘ [NOW PLAYLIST] QUEUE ‘ ; static SELECT = ‘ [NOW PLAYLIST] SELECT ‘ ; // as injectable constructor ( private acf : ActionCreatorFactory ) { this .
  • The factory allows to decalre a minimal action creator declaration with a typed payload for the action creator function and have type support when using this function.
  • Whenever a ts file is changed, it will rerun the tests.
  • npm install ngrx-action-creator-factory –save-dev
  • The service came out as a result of the open source project Echoes Player – an alternative player for watching and listening to media from youtube.

ngrx-action-creator-factory – An Action Creator Factory for ngrx
Continue reading “GitHub”

Serving processed $http response from factories in AngularJS

  • You would require factory to return only the data that you want.
  • For eg: If you inject a factory into an controller , whatever is returned by the factory is accessible to the controller .
  • Factories are injectable function that can return stuff.
  • Then ( function ( response ) { ( Notice we use ‘.
  • then ( function ( response ) { //returns a call back this .

This is just a short tutorial to explain how you can use factories in angular js to serve data from web services. In some cases you would require factory to return only the data that you want.Here we will learn hot to return processed response from factories,javascript
Continue reading “Serving processed $http response from factories in AngularJS”

Angular 2 with ASP.NET Core Web API – Build a Simple Notebook App – Part 1

  • If we rely on properties or data from other components, then we need to wait for the other components to initialize first.
  • The application connects to local controller as a REST service (Web API controller), and then display the notes received.
  • Build step by step an Angular 2 application running on IIS and ASP.NET Core.
  • When a component is created, its constructor is called, and we initialize our component.
  • It is used by the rest of the application, and it is referred as a service.

Build step by step an Angular 2 application running on IIS and ASP.NET Core. The project also has live samples. This is the first part of building an Angular 2 Notebook WebApp.; Author: Petru Faurescu; Updated: 25 Nov 2016; Section: ASP.NET; Chapter: Web Development; Updated: 25 Nov 2016
Continue reading “Angular 2 with ASP.NET Core Web API – Build a Simple Notebook App – Part 1”