Configure URL from server before http-request in Angular

Configure URL from server before http-request in Angular

For an angular application which is deployed inhouse to several customers,
the application has to figure out, where the backend server exists.

Setting the url in the environment was not useful, as each customer needs
his own url and this would end up in big build scripts.

Also the customer could not reorganize the server names on his own, without
breaking the application if he chooses to change the server name.

So we tried to be clever and to figure out where the server might be in
loading a configuration file from an untouched json file in the application.

find json file with url in application diagram

Or

Read More

Angular ControlValueAccessor by example

Angular ControlValueAccessor by example

At sLAB we currently develop an angular client for the sMOTIVE product. We wanted to extend some form controls with own behavior and had some issues with the ControlValueAccessor.

The ControlValueAccessor is Angulars interface to interact with a form control.

I did some investigations with plunker to address those issues.

plunker screenshot

  1. Outer component containing the form.
  2. Shows the properties of the form and the 'business model' (value).
  3. The form control implementing the ControlValueAccessor interface.
  4. These buttons trigger changes inside the control.
  5. The buttons trigger changes from the outer component.

my-input.component.ts

export class MyInputComponent implements ControlValueAccessor {
  myValue: any = null;
  propagateChange

Read More

Migrating t5-kletterkurs.de to Angular 2

Migrating t5-kletterkurs.de to Angular 2

As my company decides to evaluate Angular 2 as our new framework to build our web application, I thought it would be a good experience to migrate one of my own projects to Angular 2.

  1. t5-kletterkurs.de
  2. Old version
    2.1 Screenshots
  3. New version
    3.1 REST
    3.2 Angular 2
    3.3 Clarity Design System
    3.4 Screenshots

1. t5-kletterkurs.de

Geocaching is a kind of sport, where people can search for little containers with the help of GPS. Some of those containers are only reachable with professional climbing stuff.
On this site, people can order a workshop for

Read More