#JavaScript
Hidden Quirks of JavaScript `for...in` Loops
The C-style three-expression for loop in JavaScript is often viewed as old school or awkward beginner style. Some developers automatically use a for...of, foreach, or for...in statement instead. But the latter has a subtle pitfall that can lead to unexpected behaviour.
Dynamic Angular Configuration
Angular apps traditionally rely on static configuration through environment files, necessitating separate builds for each environment ‐ a cumbersome process in practical scenarios. In this blog post, we describe an alternative, where configuration is loaded dynamically at runtime, streamlining development and enhancing flexibility. As an additional benefit, we will validate the configuration against a schema and add type-safety to it.
Standalone Angular Tour Of Heroes
The popular Angular Tutorial Tour of Heroes currently does not work as described with recent Angular versions (Angular 18) because the Angular command-line tool now creates a standalone Angular app by default. You could avoid these problems by creating a non-standalone app but it is also quite instructive to just fix the problems yourself and stick with the standalone version.
Authenticating Access to Private Content Hosted with AWS CloudFront
Setting up a static website, uploading it into an S3 bucket that serves as the origin of a CloudFront distribution is a simple and cheap solution. But what if you want to control access to the content? HTTP basic authentication no longer seems to work and is clumsy and ugly anyways. But signed cookies give you a better solution at hand and it is easy to implement with serverless computing.
Pitfalls in Testing NestJS Modules using HttpService
In this blog post, we will delve into the challenges developers face when testing NestJS modules utilizing HttpService from @nestjs/axios and explore the crucial role played by the RxJS TestScheduler in overcoming these hurdles. Additionally, we will unravel the intricacies of injecting HttpService into the test module, providing you with a comprehensive guide to fortify your testing strategies and ensure the robustness of your NestJS applications.