The content of this post is based on Angular version >= 2.x unless explicitly stated otherwise. I’ve seen some complex code on Stackoverflow and elsewhere recently where the developer was using Subject and Behavior Subject as part of an Observable solution to simply share data between unrelated components with Angular. In some cases, the Observable […]
Angular Custom Services in TypeScript: Factory vs Service
In my prior post (http://bit.ly/DeborahK_AngularServices) I outlined the difference between the factory pattern and service pattern when building a custom Angular service with JavaScript. In this post we’ll look at the differences when the Angular custom service is written in TypeScript. Angular Custom Service The basic code to create an Angular custom service in TypeScript […]
Angular Custom Services: Factory vs Service
When we want reusable code in our Angular application we build a custom Angular service. We can then use that service in any Angular code that needs it. There are several types of services available in Angular, but there are two types that are used most often: Factory and Service Factory We can create a […]