DEV Community

Rainer Hahnekamp
Rainer Hahnekamp

Posted on

Ng-News: Episode 22/39

Image description

Enea Jahollari: It's ok to use function calls in Angular templates

Calling functions within a template is a known code smell. We shouldn't do that. The function will unnecessarily run multiple times because the change detection triggers it.

As always, there are exceptions to the rule. One of them is the pipe. By default, it is a normal function with a built-in cache.

Enea Jahollari explains in his article how the pipe works and how we can apply the same principles to our own functions.

As a bonus, he explains the raw source code, the Angular compiler produces out of his example.

Tim Deschryver: Watch out what you expose with Angular Interceptors

In his latest article, Tim Deschryver points out potential security risks and how to deal with them when we use HTTP interceptors. especially when an interceptor adds authentication tokens to the HTTP headers.

By default, every endpoint receives this token which is surely not the best way.

https://timdeschryver.dev/blog/watch-out-what-you-expose-with-angular-interceptors

Dany Paredes: How to build Compound Components in Angular

Another interesting article comes from Dany Parades. He discusses the compound component pattern.

Whenever a component should be flexible in terms of its usage or visualisation, you can split it up into multiple pieces, all working together using techniques like content projection or @ContentChild, etc.

https://www.danywalls.com/how-to-build-compound-components-in-angular

TypeScript 10th year anniversary

As they say, time flies. TypeScript has already its 10-year anniversary. If you are in for history or nostalgia, you can read the anniversary blog post from Daniel Rosenwasser or watch Anders Hejlsberg at the GOTO conference where he presented TypeScript to the world for the first time.

Other than that, we have new minor versions. Jest, a testing framework, to 29.1 with improved support for types. Cypress, also a testing framework, to 10.9 with new features in the area of multi-domain switching. And nx, an alternative to the Angular CLI, to 14.8.

Minor Version Releases

Jest was released in 29.1 with improved support for type inference.

Release Notes


Cypress in 10.9 with new features for multi domain switching.

Release Notes


Nx 14.8: Release Notes

Oldest comments (0)