1. angular: Detect hashchange from outside

    During my work I came up with an issue regarding detecting the location change of an Angular SPA from outside of the application. The project setup is the following: The SPA runs in an iframe (thats the functionality provided by the platform to integrate SPAs). The applications’ state (URL) should be propagated to the parent page and its browser URL to even make the SPA “deep-linkable”. This functionality is achieved by the platform by using the iframe-hash-manager library. …


  2. angular 6: Get HTTP Interceptor Instance in Test

    Testing HTTP interceptors in angular is a tricky thing. There are thousands of manuals on the web, so this article will not cover the overall “how to” for testing HTTP interceptors in angular. The article focuses on how to access the interceptors’ instance itself. …


  3. angular2+ ngFor: use custom trackBy function with component scope

    Today I stumbled over the issue that I wanted to pass a custom trackBy function to an datatable which uses the function to generate custom track IDs for my custom data set. I am passing a custom function to my datatable which returns my custom IDs: …


  4. Flexible constructors in typescript with optionals

    When initializing objects in typescript we often do not want to or can provide all properties for the object. Depending on the use case we may want to provide different values in the constructor. There is a way to achieve this: …


  5. angular HTTP requests: Use square brackets in HttpParams as parameter key/name

    Today I stumbled upon passing parameters with brackets to an REST API. In my case it was used for filtering by multiple values. …


  6. How to debug ExpressionChangedAfterItHasBeenCheckedError

    The ExpressionChangedAfterItHasBeenCheckedError is a really common error when developing Angular applications. This error is mostly hard to find. In the following lines, I will describe a possible way to find the affected variable(s)/parameters from the application to perform a deeper analysis in your code. This article will not show a way to a solution for your issue because there are many possible reasons for the error to occur (see below). …


  7. Downloading Files from REST Webservice using Angular and Observables

    In many cases you need to download files from your REST services. This article shows you a way of accomplishing that with Angular. The key to realising the download is setting the response type in the request and extracting the file content from the response. We will use the following libraries and versions: …


  8. Display alert messages using Angular and Bootstrap v4

    Bootstrap gives us the ability to show pretty alerts (see Bootstrap documentation). But they are only static components on a website. Showing alerts in your Single Page Application with Bootstrap only covers simple use cases. Thus I created a library, which enables us to show alerts on top of your page using Angular. …