In my last article, I explained how our communication with the backend takes place and how we were able to build a very simple caching mechanism thanks to signals. In this blog post, I would now like to demonstrate how we use the signals from our services within the components. Views As mentioned in the previous post, we have, broadly speaking, “Views” and “Actions” for displaying data from the backend. In the Views, primarily only data is presented, and in Actions, this...
Angular Signals – How to reuse Backend Results?
After explaining in the last blog post what Angular Signals are and how they are used, I would like to delve into how we at calitime.ch handle Signals to keep our tool TimeRocket soaring through the cosmos in this article. We don’t use HTTPClient! First and foremost, I must start with a circumstance that may not be common for many teams using Angular: We do not use HttpClient (anymore).Normally, HttpClient is the preferred tool in Angular to make HTTP requests to a server. It returns...
Angular Signals – How to use them in a simple way?
What are Signals? On May 3, 2023, Angular 16 was released, introducing the possibility to use Signals. Signals are another way to implement the reactive programming paradigm in Angular. For quite some time, RXJS has been available for this purpose, and it doesn’t seem to be disappearing from the Angular world anytime soon. Generally, the current consensus is that RXJS should be used for more complex problem scenarios since it is more powerful but also harder to grasp. However, for simpler...
NgForm with nested validation
Angular Component – part 3: Validation
This is part 3 of my series about Angular components.If you haven’t already, check out part 1 (one-way and two-way binding) and part 2 (ngModel) to see how and why to write an Angular component following the ngModel pattern.
Our goal for this part of the series is to learn how to validate your angular component’s user inputs to disable the submit of a form surrounding our form-control.
Angular Component – Part 2: ngModel
In my last article, I’ve explained how to use @Input() and @Output() and how to combine them to offer two-way binding for your component. This time I want to take this component to behave like a proper control within a <form>-element that is using ngForm. What’s ngModel, and why should I use it? In a typical Angular application, we often encounter scenarios where we have to handle forms with various input controls and a button to send data or perform some sort of action. The...
Angular Component – Part 1: one-way binding vs. two-way binding
In this short blog series, I want to show how to create an Angular component that can be used for user inputs. I know this is a topic for which many articles have been published. But while there are great tutorials that explain how it’s done, many of them lack the answer to the question of why. This is the reason I’m describing in this series how and why we are writing our components the way we do here at TimeRocket. This will be a 5-part series on the topic, so bear with me if the...