November 21, 2018

Call a method on @Input() change

Problem You probably already run into this issue. Inside a component, you want to react to the change of an @Input() value e.g. by calling a method of your component. For example we have get an @Input() filter: string from our parent component and if the @Input() changes, we want to update our data in […]
READ MORE

Admin Admin
Developer at thecodecampus </>


November 20, 2018

Building an Angular App in parallel for multiple languages

Problem When using the built-in Angular Internationalization (i18n) the Angular guide tells you in detail what you have to do to set up your application to support multiple languages. The guide lacks the details on how to properly integrate the build into a common web application deployment workflow. In this brief blog post I’m going to […]
READ MORE

Kai Henzler
Developer at thecodecampus </>


October 5, 2018

Angular 2 – Set Class of parent element with @HostBindings

With the @HostBinding() annotation, Angular gives you a useful tool to handle manipulations of css classes of parent Elements. The advantage is quite clear, the required logic remains in the components class and is not set in the template file. This makes it easier to test and improves the readability of the template file. In […]
READ MORE

Admin Admin
Developer at thecodecampus </>


July 26, 2018

Locally serving the build distribution of an Angular SPA

tl;dr Use Node Package local-web-server and its command ws with the spa flag like this: ws --spa index.html While developing an Angular based SPA usually you will use the Angular CLI as build too. The CLI has an integrated development server which is able to handle client-side routing. So whenever a reload happens and you’re […]
READ MORE

Admin Admin
Developer at thecodecampus </>


July 18, 2018

Angular, Preserving Query Params and Google AdWords

… and how all this leads to an incorrect source of traffic in Google Analytics and incorrect conversion attribution.   The situation is as follows: On www.thecodecampus.de we run an Angular 6 page. We advertise our product with Google AdWords. If a visitor comes via Google AdWords, the URL is appended with a glcid and several […]
READ MORE

Admin Admin
Developer at thecodecampus </>


March 2, 2018

The ‘this’ context of type ‘void’ is not assignable to method’s ‘this’ of type ‘Observable<{}>‘.

If you are experiencing this error – usually something with your RxJS imports is wrong. So you should go through them manually or simply delete all imports from RxJS in the corresponding file and let the IDE generate them again. Something broken could look like this:

Better working might be:

What is happening? RxJS […]
READ MORE

Admin Admin
Developer at thecodecampus </>


February 9, 2018

Angular CLI: Add Sitemap.xml and Robots.txt File

As a developer you may get the task adding a Sitemap and a robot.txt to your Angular project. This is quite easy if it is being built with Angular CLI. Copy the files next to the favicon.ico  into the /src  folder of your Angular project.

  Now open up the angular.json file in the […]
READ MORE

Admin Admin
Developer at thecodecampus </>


November 13, 2017

Getting started with Firestore and AngularFire2

A few weeks ago, Google has released its new solution for building scalable cloud databases — the Cloud Firestore. It has some nice improvements in comparison to their previous database (which used to be called Firebase but is now referred to as ‘Realtime Database’), like better data structuring and a more powerful querying API. In this […]
READ MORE

Admin Admin
Developer at thecodecampus </>