from Esslingen, Germany...

We are programmers from Esslingen and we are sharing our experience with:

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…


No 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

What we learned in 1 year of Angular 2 trainings

When we founded theCodeCampus.de in 2014 we had some year’s experience in developing angular 1 applications. We also had a few years’ experience of doing trainings for Eclipse RCP. Last year we added our angular 2 trainings, months before angular 2 was finally released! We were really surprised how well it was received, but also faced some challenges! Read on, if you’re interested in what happened in the last year,
Read more…


1 Comment

Jan Blankenhorn

Entwickler bei thecodecampus

October 17, 2016

Angular 2 use ngSwitch ngIf ngFor without additional DOM Element

Probably you want as little DOM elements as possible. You can use a ng-container instead of a regular HTML element in order to receive reduced markup. Example of ngSwitch:

Example for *ngIf:

 


No Comments

Can Kattwinkel

Entwickler bei thecodecampus

AngularJS 1: Set up Google Analytics with Google Tag Manager

There are many modules to include Google Analytics into your AngularJS project. But actually this overhead is not really required since a plain implementation is only a few lines of code. So you can spare extra modules. I highly recommend you to use Google Tag Manager in order to place the tracking information on your site since it allows you to have a professional workflow. Beyond that you can enjoy
Read more…


1 Comment

Can Kattwinkel

Entwickler bei thecodecampus

Angular 2 Animate.css Tutorial – How to use Animate.CSS in NG2 Application?

This Article will serve as a guide to implementing Animate.css animations with Angular 2 animation system. Animate.css is a popular and handy library for simple CSS Animations. We’ll apply the animation to a component and control it via a button. We will not use ngClass but convert the Animate.css to fit Angular 2 Animate. Final Result:   Git Commits as Diff: Step 1 Step 2 Step 3 Step 4 Step 5 Github Repository 
Read more…


3 Comments

Can Kattwinkel

Entwickler bei thecodecampus

Dynamically Render Components with ComponentFactoryResolver in Angular 2

In my current project I came to a situation where it was necessary to drop specific components into my view. Since the project is a game and the current view should not be tied to URLs at this point i decided not to use the router but to load my various components dynamically into my view. This gives me the power to handle the logic in one persistent smart component which is bound to
Read more…


27 Comments

Can Kattwinkel

Entwickler bei thecodecampus

Angular 2: Set up Google Analytics and Google Tag Manager

There are many modules to include Google Analytics into your Angular 2 project. But actually this overhead is not really required since a plain implementation is only a few lines of code. So you can spare extra modules. I highly recommend you to use Google Tag Manager in order to place the tracking information on your site since it allows you to have a professional workflow. Beyond that you can
Read more…


20 Comments

Can Kattwinkel

Entwickler bei thecodecampus

JS goes mobile – Native Apps with JavaScript

Have you ever heard of ‘Mobile Native JavaScript‘? – No? It’s about writing native Apps with a native look & feel, but purely in JavaScript and the web technologies you love. The past We as developers had to make the hard decision, about writing a new app either native for each platforms or a hybrid app for all the platforms at once. As always there are some drawbacks: native Apps the
Read more…


No Comments

Frederik von Berg

Entwickler bei thecodecampus

Avoid Memory Leaks in AngularJS Unit Tests

Memory Leaks When it comes to unit testing in AngularJS there are many things that, developers like us can and will do wrong. The most crucial one is to create memory leaks in our unit tests, which mostly result either in a crash of the unit test runner (browser crash) or in creating a coherence/dependency between different tests that are meant to be separated. This article shows the basic mistakes that are
Read more…


No Comments

Kai Henzler

Entwickler bei thecodecampus