Skip to content

Commit

Permalink
remove rxjs part from forms
Browse files Browse the repository at this point in the history
  • Loading branch information
lazaki committed Feb 24, 2022
1 parent b903cb1 commit 7fe998b
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions slides/11_Forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,25 +141,6 @@ <h3>Forms with baloise design system</h3>
</form>></script></code>
</pre>
</section>
<section>
<h2>Rxjs operators and error handling</h2>
<ul>
<li>Error handling and handling sucess results is done with rxjs operators in angular. For more info check <a href="https://angular.io/guide/rx-library#error-handling" target="_blank">here</a></li>
<li>Example: Return "response" from the API. If an error happens, return an empty array.</li>
</ul>
<pre>
<code class="hljs ts" data-trim>
this.http.post('/api/data', payload).pipe(
map((res: any) => {
if (!res.response) {
throw new Error('Value expected!');
}
return res.response;
}),
catchError(() => of([]))
);
</code></pre>
</section>
</section>
<section>
<h3>Task 11.1 - Forms</h3>
Expand Down

0 comments on commit 7fe998b

Please sign in to comment.