from Esslingen, Germany...

We are programmers from Esslingen and we are sharing our experience with:
February 12, 2018

Angular Universal XMLHttpRequest is not defined with HttpClient

I’ve recently had an extremely weird application behavior. The application is this server side rendered Angular page.  I discovered that the router outlet for this page was empty on the SSR result. I hadn’t noticed before since the site was bootstrapping really fast even without SSR. A quick look into Sentry – which holds our server logs  – revealed the cause. I got the following error: XMLHttpRequest is not defined This
Read more…


No Comments

Can Kattwinkel

Entwickler bei thecodecampus

February 9, 2018

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

As Developer you may get the task to add a Sitemap and a robot.txt to your Angular CLI Project, this is quite easy. Copy the files next to the favicon.ico  into the /src  folder of your Angular project.

Now open up the  .angular-cli.json  in the projects root folder and add the two files under assets , as follows:

  Restart your Angular build and the files should be served directly.
Read more…


No Comments

Frederik von Berg

Entwickler bei thecodecampus

Angular Universal Handle 404 and Set Status Codes

When working with Angular Universal we can implement a full-fledged server. Of course, this does not only include for example to display a 404 page for incorrect urls but also setting the correct status code. So that for example search engines and crawlers in general can process the result correctly. Angular itself allows us to easily create a 404 page via the router package. However, this is to be regarded
Read more…


8 Comments

Can Kattwinkel

Entwickler bei thecodecampus

November 22, 2017

Angular Full Height App Component

Since I have seen a lot of very different approaches to build up an Angular application correctly regarding the CSS positioning, I would like to talk about the different solutions in a short article. Basically it has to be said that our application is usually included in an HTML document as app-root. An index.html created with the Angular CLI looks like this:

The app-root element refers to our AppComponent. Here we
Read more…


No Comments

Can Kattwinkel

Entwickler bei 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 post I’m going to go through everything you need to get started with Cloud Firestore
Read more…


No Comments

Mark Kvetny

Entwickler bei thecodecampus

November 2, 2017

Material 2: Sticky Footer with Mat Sidenav

A very common use case for the sidenav of Material 2 is the use in a layout with a sticky footer. Unfortunately, the documentation of the Mat-Sidenav does not show how to do this best. But that’s not a big deal, because you can achieve your goal quickly if you know how to use Flexbox. We assume that routing is used. In addition to the sticky footer, we want to make sure
Read more…


4 Comments

Can Kattwinkel

Entwickler bei thecodecampus

Angular Serverside Validation with Hibernate and Redux

What is this article about? If you develop a web application with Angular, sooner or later you will run into the following problem: Where will the data generated by the client be validated? Client side validation is included in Angular, and gives the user a fast feedback about the correctness of his data. This is a standard in today’s web application. As most Angular Apps are running against a server
Read more…


No Comments

Jan Blankenhorn

Entwickler bei thecodecampus

Angular HTTP Testing “SyntaxError: Unexpected token o in JSON at position 1”

tl:dr; Solve this Issue: Add the following line to your imports:

  Full version: A common problem affecting many developers when writing tests for the Angular 4 HTTP service is the following stack trace. It occurs if you assemble an response using a the wrong class. The call of .json()will throw the error.

It throws because the response is of a false type and the body of
Read more…


2 Comments

Can Kattwinkel

Entwickler bei thecodecampus

Reuse Angular Code within NativeScript Apps

NativeScript is a great framework to write mobile Apps for Android and iOS with Angular (2, 4 and so on). Read on, if you: have an existing Angular Web App or are planning to develop one you want to offer a native App for Android and iOS without a lot of extra work TL;DR It is possible to reuse code, especially Services and Pipes, if you are lucky some of the
Read more…


No Comments

Frederik von Berg

Entwickler bei thecodecampus

May 5, 2017

Nativescript: Actionbar with Android Material Design Icons

Have you ever wondered how you can get a Action Bar like this one in Nativescript? It’s easy: I hope you have Android Studio preinstalled, you need it. Create and open a example Android Project with Android Studio. Now Right-Click on your Project Folder, select   New -> Vector Asset which opens a new Dialog. You can select the Icon you want and click Next. Note the path, where the file is saved. In your
Read more…


No Comments

Frederik von Berg

Entwickler bei thecodecampus