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

Avatar photo

theCodeCampus
Developer at thecodecampus </>


October 27, 2018

Install Docker on Ubuntu 18.10

Currently there is no official release of Docker available for Ubuntu 18.10. Therefore you’ll run into errors like this one: 

But there is already a way to utilize the test repo to have Docker for Ubuntu 18.10:

Before you apply this fix, please check if the official resources have been updated at: https://docs.docker.com/install/linux/docker-ce/ubuntu/

Avatar photo

theCodeCampus
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

Avatar photo

theCodeCampus
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

Avatar photo

theCodeCampus
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

Avatar photo

theCodeCampus
Developer at thecodecampus </>


May 7, 2018

Use Git Bash, Cmder or ConEmu as default terminal in IntelliJ IDEA on Microsoft Windows

This post will show you how to easily set the default Terminal to a Unix/bash like terminal in IntelliJ IDEA on Windows. As the Windows CMD.EXE is quite limited in it’s functionality (and usability) you might already be using some UNIX-like terminal emulator like Git Bash (which comes with Git for Windows, so you might […]
READ MORE

Avatar photo

theCodeCampus
Developer at thecodecampus </>


March 5, 2018

Throwing Errors in Npm Build Script

From time to time you may want to throw an error from within an npm build script. This should be done in such a way that the complete execution of the script is recognized as faulty. So that for example, a build server recognizes that a script did not run successfully. You only need to […]
READ MORE

Avatar photo

theCodeCampus
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

Avatar photo

theCodeCampus
Developer at thecodecampus </>


February 23, 2018

Creating a CORS Middleware in nest.js

Nest.js is a great framework for writing REST-API’s using Node.js. It features Angular’s dependency injection, an complete TypeScript integration and helps you with structuring your code. A common issue when working with REST-API’s is Cross-Origin-Request-Sharing (CORS), which keeps your Angular client from requesting resources which are located on another domain. Let’s pretend, for instance your […]
READ MORE

Avatar photo

theCodeCampus
Developer at thecodecampus </>