{"id":2829,"date":"2024-04-11T09:03:44","date_gmt":"2024-04-11T07:03:44","guid":{"rendered":"https:\/\/www.thecodecampus.de\/blog\/?p=2829"},"modified":"2025-04-17T13:15:52","modified_gmt":"2025-04-17T11:15:52","slug":"how-to-combine-angular-signals-and-rxjs","status":"publish","type":"post","link":"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/","title":{"rendered":"Angular Signals Part 2 &#8211; How to combine Angular Signals and RxJS"},"content":{"rendered":"<p><strong><em>Klicke <a href=\"https:\/\/www.thecodecampus.de\/blog\/wie-kombiniert-man-angular-signals-und-rxjs\/\">hier<\/a> f\u00fcr die deutsche Version des Blog-Posts.<\/em><\/strong><\/p>\n<h2>Angular 17: Signals + RxJS = Perfect Match<\/h2>\n<p>In the first article of this series, <a href=\"https:\/\/www.thecodecampus.de\/blog\/angular-signals-part-1\/\">Angular Signals Part 1 &#8211; How-to guide on Angular Signals<\/a>, we summarized what Angular Signals are and how to use them. Now let&#8217;s take a look at why Signals are not a replacement for RxJS and how to best combine both technologies.<\/p>\n<p><a href=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/04\/Angular-Signals-Part-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"1200\" class=\"aligncenter wp-image-2878\" style=\"width: 600px; height: auto;\" src=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/04\/Angular-Signals-Part-2.png\" alt=\"Angular Signals Part 2\" srcset=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/04\/Angular-Signals-Part-2.png 1200w, https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/04\/Angular-Signals-Part-2-300x300.png 300w, https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/04\/Angular-Signals-Part-2-1024x1024.png 1024w, https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/04\/Angular-Signals-Part-2-150x150.png 150w, https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/04\/Angular-Signals-Part-2-768x768.png 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<p>As already mentioned, Signals are particularly well suited to managing synchronous states in the application. However, this means that they take over a task that was previously handled by RxJS. So the question is whether Signals will completely replace RxJS?<\/p>\n<p>The answer is: No.<\/p>\n<p>To understand why RxJS does not become less important with the use of Signals, you need to know the application purposes of the technologies and their strengths and weaknesses. This is exactly what we will do in this article.<\/p>\n<h2>Strengths and weaknesses of the technologies<\/h2>\n<p>To choose the right technology for the right application, you need to know about its advantages and disadvantages. Next, we will look at the strengths and weaknesses of Signals and RxJS.<\/p>\n<h3>RxJS<\/h3>\n<p>The following section is of course not a complete analysis or introduction to RxJS. It is only intended to provide an overview so that an assessment and differentiation can be made regarding Angular Signals. If you would like to know more about RxJS, you can take a look at its documentation <a href=\"https:\/\/rxjs.dev\/guide\/overview#introduction\">here<\/a>.<\/p>\n<p>There are two areas that RxJS covers. One is the management and coordination of asynchronous events, the other is reactive programming. With the observable pattern, RxJS can efficiently handle asynchronous events and operations as data streams.<\/p>\n<p>The large number of operators, such as <code>map<\/code> or <code>filter<\/code>, which are available for processing and converting observables, is a great strength of RxJS. This allows complex tasks, such as coordinating multiple events or combining data streams, to be solved in a simple and readable way. Observables also allow us to handle and process HTTP events such as success, error and completion. With the HTTP client, Angular even provides us with a service that allows us to work directly with observables. In contrast to working with promises in JavaScript.<\/p>\n<p>RxJS, with libraries like <a href=\"https:\/\/github.com\/w11k\/Tydux\">Tydux<\/a> and <a href=\"https:\/\/ngrx.io\/docs\">NgRx<\/a>, has been the go-to for global state management so far. At this point, signals can now make our lives much easier.<\/p>\n<h3>Angular Signals<\/h3>\n<p>In contrast to RxJS, Signals have limited functionality when it comes to reacting to events. Since you can only use the <code>effect()<\/code> and <code>computed()<\/code> function to react to changes and do not have as many and extensive operators at hand, more complex tasks in particular can lead to a lot of unreadable code. Signals do not have classic and well-known operators such as <code>catchError<\/code> or <code>switchMap<\/code>, which are responsible for canceling requests at a certain point in time when a new request with new data arrives.<\/p>\n<p>Signals do not aim to replace RxJS entirely, but to simplify reactive programming.<br \/>\nA good example are the following code blocks, which both represent the same functionality. If the variables <code>firstName<\/code> or <code>lastName<\/code> change, the variable <code>fullName<\/code> should be updated.<\/p>\n<p>The first block shows how RxJS solves this task with the <code>fullName$<\/code> observable. We use <code>combineLatest<\/code> to create a new observable that combines our two observable sources. We must remember that <code>combineLatest<\/code> only produces values if both <code>firstName$<\/code> and <code>lastName$<\/code> have returned a value at least once. To use the actual value of <code>fullName$<\/code>, we need to subscribe to the observable. Then we also have to take care of terminating the subscription.<\/p>\n<div>\n<pre class=\"lang:default decode:true\">public fullName: string | null = null \r\npublic fullName$ = combineLatest([this.firstName$, this.lastName$]).pipe( \r\n  map(([firstName, lastName]) =&gt;`${firstName} ${lastName}`), \r\n);\r\n\r\n\/\/ Usage with subscription and takeUntilDestroyed operator \r\nfullName$ \r\n  .pipe(takeUntilDestroyed()) \r\n  .subscribe(fullName =&gt; this.fullName = fullName)\r\n<\/pre>\n<\/div>\n<p>With signals, using the <code>computed()<\/code> function, the whole thing looks different. We access the value of a signal by using the round brackets. In the <code>computed()<\/code> function, the dependencies on the content of the signals <code>firstName<\/code> and <code>lastName<\/code> are automatically recorded, just because we have used their content. We also no longer need to manage subscriptions. And last but not least, signals always have an initial value when they are created.<\/p>\n<div>\n<pre class=\"lang:default decode:true\">fullName = computed(() =&gt; { \r\n  return`${this.firstName()} ${this.lastName()}`; \r\n}); \r\n\r\n\/\/ Usage with () \r\nfullName()<\/pre>\n<\/div>\n<p>RxJS is a powerful and versatile tool with many powerful operators. We need to understand the behavior of the individual operators in order to be able to work safely with RxJS. In addition, we have to take care of the creation and combination of observables and their subscriptions. Signals, on the other hand, are simpler to use. We do not need to manage subscriptions and dependencies. However, the execution of Signals is synchronous and can therefore only replace the synchronous parts of RxJs and simplify programming and state management.<\/p>\n<p><a href=\"https:\/\/www.thecodecampus.de\/schulungen\/angular\" style=\"display: inline-block;\">\n<picture><source srcset=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/angular-schulungen_frieder_WP_big.png\" media=\"(min-width: 1024px)\"><source srcset=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/angular-schulungen_frieder_WP_medium.png\" media=\"(min-width: 600px)\"><img decoding=\"async\" src=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/angular-schulungen_frieder_WP_small.png\" alt=\"Angular Schulungen\" class=\"alignnone size-full wp-image-38\">\n<\/picture>\n<\/a><\/p>\n<h2>How to combine the two approaches?<\/h2>\n<p>Now that we have established that RxJS is still important and relevant, the question remains of how to use the two technologies together. In principle, exactly as we stated above. Signals are used for synchronous operations, such as state management, and all asynchronous operations, such as events and queries to the database, are handled with RxJS.<\/p>\n<p>There are two functions that ensure that this interaction works smoothly.<\/p>\n<h3>toSignal()<\/h3>\n<p>The <code>toSignal()<\/code> function can be used to generate a readonly signal that tracks the value of an observable.<br \/>\nIn our example, we have an observable <code>movies$<\/code>, which is waiting for the response of an HTTP request, in our case a list of movies. The Signal <code>movies<\/code> is linked to <code>movies$<\/code> with <code>toSignal()<\/code> and as soon as the response is there and the observable outputs the movies received, the <code>movies<\/code> Signal is also updated.<\/p>\n<div>\n<pre class=\"lang:default decode:true\">private movies$ = this.http.get&lt;MovieResponse&gt;(this.url).pipe(\r\n  map((data) =&gt;\r\n    data.results.map((m) =&gt; ({...m}) as Movie),\r\n  ),\r\n  shareReplay(1),\r\n);\r\n\r\nmovies = toSignal(this.movies$);<\/pre>\n<\/div>\n<p>We can then use this Signal in the template to display the movies. This means that we no longer need an async pipe in the template.<\/p>\n<p><code>toSignal()<\/code> subscribes by itself to the corresponding observable and also unsubscribes automatically if the component or service in which the call was made is destroyed.<\/p>\n<p>However, there is one more thing to watch out for. Since <code>toSignal()<\/code> immediately subscribes to the observable, various side effects can occur. For example, if an HTTP request is attached to the observable, this call is executed immediately, regardless of whether there is currently a component that wants the data. This can be particularly difficult in shared services.<br \/>\nMemory leaks are also something to keep in mind. <code>toSignal()<\/code> can only be called in an injection context or with an injector. This means that if the injector, and the associated Signal, exist beyond the lifecycle of the component, memory leaks may occur. This is particularly the case if <code>toSignal()<\/code> is called in root services or root components.<\/p>\n<h3>toObservable()<\/h3>\n<p>In contrast to <code>toSignal()<\/code>, <code>toObservable()<\/code> is used to create an observable that tracks the value of a Signal. This allows you to trigger another HTTP request, for example, and reload further data.<br \/>\nIn our example, we have a Signal <code>selectedMovie<\/code> that saves the movie that the user has just clicked on. With <code>toObservable()<\/code> we can react every time <code>selectedMovie<\/code> changes and make another HTTP request in the observable pipeline to retrieve the characters of the movie. We then intercept the corresponding response with the <code>movieCharacters$<\/code> observable.<\/p>\n<div>\n<pre class=\"lang:default decode:true \">selectedMovie = signal&lt;Movie | undefined&gt;(undefined);\r\n\r\nprivate movieCharacters$ = toObservable(this.selectedMovie).pipe(\r\n  \/\/... See the complete code in the StackBlitz below\r\n  this.http.get&lt;Character&gt;(characterUrl))),\r\n  ),\r\n);<\/pre>\n<\/div>\n<p>This allows us to react to synchronous state changes with asynchronous operations. The <code>movieCharacter$<\/code> observable can now also be made available again with a signal for templates.<br \/>\nWith the <code>toSignal()<\/code> and <code>toObservable()<\/code> function, asynchronous processes can be handled and encapsulated very well in the service. Only signals that are used for synchronous state management are then accessible to the outside.<\/p>\n<h2>ngxtension<\/h2>\n<p><a href=\"https:\/\/ngxtension.netlify.app\/getting-started\/introduction\/\">ngxtension<\/a> is a library with utility functions for Angular, which are intended to make development with Angular more convenient. There are already more than ten functions that make working with Signals easier. We would now like to introduce two of these functions that we find the most practical.<\/p>\n<h3>toLazySignal()<\/h3>\n<p>The <a href=\"https:\/\/ngxtension.netlify.app\/utilities\/signals\/to-lazy-signal\/\">toLazySignal()<\/a> function works in a similar way to the original <code>toSignal()<\/code> function, with the exception that a subscription is not generated immediately. <code>toLazySignal()<\/code> therefore comes into play exactly where we saw a problem with <code>toSignal()<\/code> above. Only when the signal is read for the first time does Angular subscribe to the corresponding observable.<\/p>\n<pre class=\"\">const people = toSignal(this.people$);\r\n\r\nconst planets = toLazySignal(this.planets$);<\/pre>\n<p>You can see from this code snippet that the functions are used in exactly the same way. In the embedded StackBlitz project, we have also compared the two functions in a component so that you can try out the subscriptions for yourself.<\/p>\n<h3>connect()<\/h3>\n<p>The <a href=\"https:\/\/ngxtension.netlify.app\/utilities\/signals\/connect\/\">connect()<\/a> function links a signal with an observable. This doesn&#8217;t sound any different from the <code>toSignal()<\/code> function, but while <code>toSignal()<\/code> only returns a readonly signal, <code>connect()<\/code> returns a writeable signal.<\/p>\n<p>So if you want to set the value of a signal based on an observable, you can do this as shown in the following example:<\/p>\n<div>\n<pre class=\"\">connect(this.signalName, this.connectForm.valueChanges);<\/pre>\n<\/div>\n<p>The Signal <code>signalName<\/code> is linked to the <code>valueChanges<\/code> observable of the FormControl. Whenever the form is updated because the entered value is changed, the Signal is also updated.<\/p>\n<p>However, <code>connect()<\/code> does not only have this one application purpose. It is also possible to connect two Signals with each other, whereby a writeable Signal is obtained again, and <code>connect()<\/code> also makes it possible to connect any number of streams with just one Signal. There are therefore a large number of use cases where the <code>connect()<\/code> function makes your work easier.<\/p>\n<h2>Experience is the best teacher: Hands-On with Signals and RxJS<\/h2>\n<p>Are you ready to put theory into practice? In this interactive StackBlitz example, we&#8217;ve created a sample application that takes the basic concepts of RxJS and Signals and includes all the examples and features presented. Dive in and experiment to see Signals and RxJS in action!<\/p>\n<p><iframe height=\"400\" style=\"width: 100%;\" src=\"https:\/\/stackblitz.com\/edit\/stackblitz-starters-jmu8cv?embed=1&amp;file=src%2Fmain.ts\" scrolling=\"no\" data-mce-fragment=\"1\"><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><\/iframe><\/p>\n<h2>And now what?<\/h2>\n<p>Angular Signals are still relatively new and it remains to be seen how things will develop with Signals in future Angular versions. Since we are all learning every day and we want to make working with Signals even easier for you, we want to take a closer look at Signal Inputs in the <a href=\"https:\/\/www.thecodecampus.de\/blog\/what-advantages-have-angular-signal-inputs\/\">next article<\/a> in this series and compare them with the classic <code>@Input<\/code> decorator.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the first article of this series, Angular Signals Part 1 &#8211; How-to guide on Angular Signals, we summarized what Angular Signals are and how to use them. Now let&#8217;s take a look at why Signals are not a replacement for RxJS and how to best combine both technologies. As already mentioned, Signals are particularly well suited to managing synchronous states in the application. However, this means that they take over a task that was previously handled by RxJS. So the question is whether Signals will completely replace RxJS? The answer is: [&#8230;]<\/p>\n","protected":false},"author":32,"featured_media":2878,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73,164,163,168,169,151,162],"tags":[112,170,172,171,173,175,174,176],"class_list":["post-2829","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-angular","category-angular-17","category-angular-performance-optimization","category-angular-signals","category-change-detection","category-optimization","category-performance","tag-angular","tag-angular-17","tag-angular-change-detection","tag-angular-signals","tag-reactive-primitive","tag-reactive-programming","tag-rxjs","tag-state-management"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Angular Signals Part 2 - How to combine Angular Signals and RxJS<\/title>\n<meta name=\"description\" content=\"Angular 17: Find out how Signals and RxJS can be perfectly combined and improve the reactivity of your application!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Angular Signals Part 2 - How to combine Angular Signals and RxJS\" \/>\n<meta property=\"og:description\" content=\"Angular 17: Find out how Signals and RxJS can be perfectly combined and improve the reactivity of your application!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Development tips and tricks - theCodeCampus Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-11T07:03:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-17T11:15:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/04\/Angular-Signals-Part-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"1200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Anne Naumann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Anne Naumann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/how-to-combine-angular-signals-and-rxjs\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/how-to-combine-angular-signals-and-rxjs\\\/\"},\"author\":{\"name\":\"Anne Naumann\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/person\\\/d5533850d6a4d364e194500c24c0021a\"},\"headline\":\"Angular Signals Part 2 &#8211; How to combine Angular Signals and RxJS\",\"datePublished\":\"2024-04-11T07:03:44+00:00\",\"dateModified\":\"2025-04-17T11:15:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/how-to-combine-angular-signals-and-rxjs\\\/\"},\"wordCount\":1590,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/how-to-combine-angular-signals-and-rxjs\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/Angular-Signals-Part-2.png\",\"keywords\":[\"Angular\",\"Angular 17\",\"Angular Change Detection\",\"Angular Signals\",\"Reactive Primitive\",\"Reactive Programming\",\"RxJS\",\"State Management\"],\"articleSection\":[\"Angular\",\"Angular 17\",\"Angular Performance Optimization\",\"Angular Signals\",\"Change Detection\",\"Optimization\",\"Performance\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/how-to-combine-angular-signals-and-rxjs\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/how-to-combine-angular-signals-and-rxjs\\\/\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/how-to-combine-angular-signals-and-rxjs\\\/\",\"name\":\"Angular Signals Part 2 - How to combine Angular Signals and RxJS\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/how-to-combine-angular-signals-and-rxjs\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/how-to-combine-angular-signals-and-rxjs\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/Angular-Signals-Part-2.png\",\"datePublished\":\"2024-04-11T07:03:44+00:00\",\"dateModified\":\"2025-04-17T11:15:52+00:00\",\"description\":\"Angular 17: Find out how Signals and RxJS can be perfectly combined and improve the reactivity of your application!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/how-to-combine-angular-signals-and-rxjs\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/how-to-combine-angular-signals-and-rxjs\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/how-to-combine-angular-signals-and-rxjs\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/Angular-Signals-Part-2.png\",\"contentUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/Angular-Signals-Part-2.png\",\"width\":1200,\"height\":1200,\"caption\":\"Angular Signals Part 2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/how-to-combine-angular-signals-and-rxjs\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Angular Signals Part 2 &#8211; How to combine Angular Signals and RxJS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\",\"name\":\"Web Development tips and tricks - theCodeCampus Blog\",\"description\":\"Tips, tricks, and experiences about developing web and mobile applications with Angular, TypeScript, and Testing.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\",\"name\":\"theCodeCampus\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch.jpg\",\"contentUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch.jpg\",\"width\":156,\"height\":156,\"caption\":\"theCodeCampus\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/person\\\/d5533850d6a4d364e194500c24c0021a\",\"name\":\"Anne Naumann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/anne-naumann-tcc-author-96x96.webp\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/anne-naumann-tcc-author-96x96.webp\",\"contentUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/anne-naumann-tcc-author-96x96.webp\",\"caption\":\"Anne Naumann\"},\"description\":\"Hi, I'm a web developer with a focus on frontend technologies, especially Angular. I also have a lot of fun when it comes to UI\\\/UX and when I need to make room for new books on my bookshelves.\",\"sameAs\":[\"https:\\\/\\\/thecodecampus.de\\\/ueber-uns\\\/trainer\\\/anne-naumann\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/anne-naumann-1ab635307\\\/\"],\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/author\\\/anaumann\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Angular Signals Part 2 - How to combine Angular Signals and RxJS","description":"Angular 17: Find out how Signals and RxJS can be perfectly combined and improve the reactivity of your application!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/","og_locale":"en_US","og_type":"article","og_title":"Angular Signals Part 2 - How to combine Angular Signals and RxJS","og_description":"Angular 17: Find out how Signals and RxJS can be perfectly combined and improve the reactivity of your application!","og_url":"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/","og_site_name":"Web Development tips and tricks - theCodeCampus Blog","article_published_time":"2024-04-11T07:03:44+00:00","article_modified_time":"2025-04-17T11:15:52+00:00","og_image":[{"width":1200,"height":1200,"url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/04\/Angular-Signals-Part-2.png","type":"image\/png"}],"author":"Anne Naumann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Anne Naumann","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/#article","isPartOf":{"@id":"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/"},"author":{"name":"Anne Naumann","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/person\/d5533850d6a4d364e194500c24c0021a"},"headline":"Angular Signals Part 2 &#8211; How to combine Angular Signals and RxJS","datePublished":"2024-04-11T07:03:44+00:00","dateModified":"2025-04-17T11:15:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/"},"wordCount":1590,"commentCount":0,"publisher":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#organization"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/#primaryimage"},"thumbnailUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/04\/Angular-Signals-Part-2.png","keywords":["Angular","Angular 17","Angular Change Detection","Angular Signals","Reactive Primitive","Reactive Programming","RxJS","State Management"],"articleSection":["Angular","Angular 17","Angular Performance Optimization","Angular Signals","Change Detection","Optimization","Performance"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/","url":"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/","name":"Angular Signals Part 2 - How to combine Angular Signals and RxJS","isPartOf":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/#primaryimage"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/#primaryimage"},"thumbnailUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/04\/Angular-Signals-Part-2.png","datePublished":"2024-04-11T07:03:44+00:00","dateModified":"2025-04-17T11:15:52+00:00","description":"Angular 17: Find out how Signals and RxJS can be perfectly combined and improve the reactivity of your application!","breadcrumb":{"@id":"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/#primaryimage","url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/04\/Angular-Signals-Part-2.png","contentUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/04\/Angular-Signals-Part-2.png","width":1200,"height":1200,"caption":"Angular Signals Part 2"},{"@type":"BreadcrumbList","@id":"https:\/\/www.thecodecampus.de\/blog\/how-to-combine-angular-signals-and-rxjs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.thecodecampus.de\/blog\/"},{"@type":"ListItem","position":2,"name":"Angular Signals Part 2 &#8211; How to combine Angular Signals and RxJS"}]},{"@type":"WebSite","@id":"https:\/\/www.thecodecampus.de\/blog\/#website","url":"https:\/\/www.thecodecampus.de\/blog\/","name":"Web Development tips and tricks - theCodeCampus Blog","description":"Tips, tricks, and experiences about developing web and mobile applications with Angular, TypeScript, and Testing.","publisher":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.thecodecampus.de\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.thecodecampus.de\/blog\/#organization","name":"theCodeCampus","url":"https:\/\/www.thecodecampus.de\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch.jpg","contentUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch.jpg","width":156,"height":156,"caption":"theCodeCampus"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/person\/d5533850d6a4d364e194500c24c0021a","name":"Anne Naumann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/11\/anne-naumann-tcc-author-96x96.webp","url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/11\/anne-naumann-tcc-author-96x96.webp","contentUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/11\/anne-naumann-tcc-author-96x96.webp","caption":"Anne Naumann"},"description":"Hi, I'm a web developer with a focus on frontend technologies, especially Angular. I also have a lot of fun when it comes to UI\/UX and when I need to make room for new books on my bookshelves.","sameAs":["https:\/\/thecodecampus.de\/ueber-uns\/trainer\/anne-naumann","https:\/\/www.linkedin.com\/in\/anne-naumann-1ab635307\/"],"url":"https:\/\/www.thecodecampus.de\/blog\/author\/anaumann\/"}]}},"_links":{"self":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/2829","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/comments?post=2829"}],"version-history":[{"count":18,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/2829\/revisions"}],"predecessor-version":[{"id":3396,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/2829\/revisions\/3396"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/media\/2878"}],"wp:attachment":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/media?parent=2829"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/categories?post=2829"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/tags?post=2829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}