Category Archives: Angular 4

Angular 4.3 HTTPClient API

Rick HerrmannIn the 4.3 release of Angular, there was a new HttpClient API introduced.  HttpClient is an alternative to the existing Http module and exists in its own package (@angular/common/http).  For any projects that are using Angular 4.x, both Http and HttpClient are supported so you don’t have to migrate to the HttpClient all at once.  However, in Angular 5x, the original HttpModule is deprecated so only HttpClient is supported.  Hopefully with this overview you will see that HttpClient is actually easier to use and switching from Http will simplify your http service calls. Read more

Router Events in Angular

Interactive Business Systems is now Planet Technology. Looking for a new job? We work with some of the biggest names in tech, and we’re hiring! Check out our open jobs and make your next career move with Planet.


When working with Angular Routing, it’s very useful to be able to respond to routing events – the most obvious and useful being when the route changes. In AngularJS this was accomplished with by attaching a callback function to one the “$routeChange” events on the $scope. In Angular the concept is similar but has some key (and in my opinion, useful) differences.

Once you have a reference to the Router for your application you can subscribe to its “events” observable. This observable will emit a route-event whenever applicable that you can listen for. Being an observable you can subscribe to it in multiple places, filter for the specific event you want, transform the raw event, or anything else you could do with an observable.

Read more

Custom Validators for Angular 4

Interactive Business Systems is now Planet Technology. Looking for a new job? We work with some of the biggest names in tech, and we’re hiring! Check out our open jobs and make your next career move with Planet.


On a recent Angular 4 project I had the need to use some custom form validations.  Out of the box, Angular 4 contains validators for required, email, pattern, and min/max length, and it is possible to write your own validators as well.  In particular, the custom validation I needed to do was verify that two fields were equal.  For example, a form where the user enters a phone number, and then confirms the phone number in a second form field.  The custom validation would verify that the two text inputs had the same value.

Read more

« Older Entries