Analyze ways to retrieve data with signals and HttpClient in Angular

Loading

Reading Time: 5 minutes Introduction In this blog post, I would like to discuss how signal and HttpClient can retrieve data in Angular. In my observation, I found 5 data retrieval patterns and each one has its pros and cons. When the post analyzes data retrieval in Angular, I hope the readers can choose their preferred choice and apply … Read more

Customize component using ViewContainerRef and signals in Angular

Loading

Reading Time: 5 minutes Introduction In this blog post, I want to describe how to perform UI customization using ViewContainerRef and Angular signals. Originally, I have a PokemonTabComponent that renders dynamic components using ViewContainerRef and the components are assigned a pokemon input. After rewrite, I refactor these components to inject Pokemon service in order to access the pokemon signal. … Read more

Customize component using ngComponentOutlet and signals in Angular

Loading

Reading Time: 4 minutes Introduction In this blog post, I want to describe how to do UI customization using ngComponentOutlet and Angular signals. Originally, I had a PokemonTabComponent that renders dynamic components using ngComponentOutlet and RxJS. I refactored the component to use signals and the code is surprisingly short, easy to understand and maintain. Moreover, I apply “signals in … Read more

Service with a Signal in Angular

Loading

Reading Time: 5 minutes Introduction In this blog post, I would like to convert “Service with a Subject” to “Service with a Signal ” and expose signals only. It is made possible by calling toSignal to convert Observable to signal. Then, I can pass signal values to Angular components to display data. After using signal values directly in the … Read more

Make RxJS and Angular Signal coexist in Pokemon Application

Loading

Reading Time: 5 minutes Introduction I wrote a simple Pokemon application in Angular 15 and RxJS to display image URLs of a specific Pokemon. There are 2 methods to update current Pokemon Id in order to update image URLS. The first method is by clicking buttons to increment or decrement the id by a delta. The other method is … Read more