WebTech


Posted by Steven

Yesterday, we had flickering tests in our Angular application, which uses NgRx. Hopping from one test to the next and even sometimes running green, we had this error:

Uncaught TypeError: Cannot read property 'entities' of undefined

Here's the simple solution: Destroy the fixture after each test:

afterEach(() => {
  fixture.destroy();
});

 

Posted by Steven

Recently, my team and I had a discussion about naming conventions in TypeScript. The question was if to name observables with or without a dollar sign like this:

Posted by Steven

I spend the bigger part of yesterday figuring out why my Spring Boot app was not recognized as such in Pivotal Cloudfoundry app manager. The Spring Boot logo was not displayed in front of the app name and I couldn't configure the log levels or see the "Trace" and "Thread" tabs. Short answer: I used a custom context path. That doesn't work with the Actuator integration in Cloudfoundry. Read more for details ...

Posted by Steven

While writing some Protractor tests yesterday, I came across this error:

Posted by Steven

This will be a short one.

I am working on an Angular 6 application that is deployed on a Pivotal Cloud Foundry, using the nginx-buildpack. With the default nginx.conf, http and https requests are served. The https request is secured using the certificate for *cfapps.io, which is nice to have without any configuration.

However, allowing http requests opens the door for accidental unencrypted logins, which I want to avoid. Hence, I want to forward all http-requests to https.

Here's the working nginx.conf for this:

Posted by Steven

This article is about deploying an Angular 6 application to Pivotal Cloud Foundry so that URLs without a hash can be used.

Posted by Steven

Recently, we decided which UI library we should use in our Angular app. This article is about the aspects we took into account and why we decided to use PrimeNG (spoiler alert!).

PrimeNG was already integrated in the codebase and used in a few places. Because of that, it would have been possible to change to another library if necessary. We didn’t want to use PrimeNG simply because it already has been there, so we compared it to other solutions.

Posted by Steven

Angular supports the setup of unit testing via it’s build-in TestBed. This class can be used to configure the environment the unit test runs in, including the available modules:

Posted by Steven

I wrote about Angular and Bootstrap before. Here, I documented how to add Bootstrap manually to Angular. Here, I wrote about ng-bootstrap and that it's the best fit for using Bootstrap with Angular. Recently, my team and I had to decide if to use a third option: ngx-bootstrap. This article is about the decision what option to use:

Posted by Steven

Learning how an Angular app can be secured with JWT, I found two wonderful blog posts that showed how to implement a basic setup. If forked both of the corresponding repositories and upgraded the server side to Spring Boot 2. So if you need a working but small example on how to use JWT with Angular, here you go:

Pages