{"id":1872,"date":"2023-12-12T05:00:00","date_gmt":"2023-12-12T13:00:00","guid":{"rendered":"https:\/\/www.angulartraining.com\/daily-newsletter\/?p=1872"},"modified":"2023-12-11T11:36:27","modified_gmt":"2023-12-11T19:36:27","slug":"code-challenge-2-solution","status":"publish","type":"post","link":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/","title":{"rendered":"Code challenge #2 Solution"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In yesterday&#8217;s <a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-di-or-not-di\/\" target=\"_blank\" rel=\"noopener\" title=\"\">code challenge<\/a>, our application wasn&#8217;t displaying any data. There were two reasons for that problem:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>HttpClient<\/code> was not provided in the application<\/li>\n\n\n\n<li>The <a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/change-detection-for-angular-components\/\" target=\"_blank\" rel=\"noopener\" title=\"\">change detection strategy<\/a> <code>OnPush<\/code> wasn&#8217;t compatible with the data flow of the application<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;m including links to previous newsletter entries for deeper dives on the different topics involved in that solution. And there are quite a few subtleties to overcome.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s tackle the first issue, which was providing the HTTP client. We can use one of the several <a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/standalone-application-and-router-config\/\" target=\"_blank\" rel=\"noopener\" title=\"\">utility functions for standalone app config<\/a>, in our case, <code><a href=\"https:\/\/angular.dev\/api\/common\/http\/provideHttpClient\" target=\"_blank\" rel=\"noopener\" title=\"\">provideHttpClient<\/a><\/code>:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"804\" height=\"100\" src=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2023\/12\/image-10.png\" alt=\"\" class=\"wp-image-1873\" srcset=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2023\/12\/image-10.png 804w, https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2023\/12\/image-10-300x37.png 300w, https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2023\/12\/image-10-768x96.png 768w\" sizes=\"auto, (max-width: 804px) 100vw, 804px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The second problem can be solved in two different ways:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Remove change detection <code>onPush<\/code> to use the <code>default<\/code> one instead<\/li>\n\n\n\n<li>Use the <a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/async-pipe-signals-and-change-detection\/\" target=\"_blank\" rel=\"noopener\" title=\"\"><code>async<\/code> pipe or Signals to trigger change detection<\/a> in that <code>OnPush<\/code> component<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Because it&#8217;s always <a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/how-to-avoid-memory-leaks-with-rxjs-observables\/\" target=\"_blank\" rel=\"noopener\" title=\"\">better to use the <code>async<\/code> pipe<\/a>, I&#8217;m going with that option in our template:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"688\" height=\"191\" src=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2023\/12\/image-11.png\" alt=\"\" class=\"wp-image-1874\" srcset=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2023\/12\/image-11.png 688w, https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2023\/12\/image-11-300x83.png 300w\" sizes=\"auto, (max-width: 688px) 100vw, 688px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In our component class, I stored the Observable from our service instead of storing the data. No more constructor needed:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"196\" src=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2023\/12\/image-12.png\" alt=\"\" class=\"wp-image-1875\" srcset=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2023\/12\/image-12.png 650w, https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2023\/12\/image-12-300x90.png 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can see that <a href=\"https:\/\/stackblitz.com\/edit\/at-code-challenge-2-solution?description=An%20angular-cli%20project%20based%20on%20@angular\/animations,%20@angular\/common,%20@angular\/compiler,%20@angular\/core,%20@angular\/forms,%20@angular\/platform-browser,%20@angular\/platform-browser-dynamic,%20@angular\/router,%20core-js,%20rxjs,%20tslib%20and%20zone.js&amp;file=src%2Fmain.ts,src%2Fdata.service.ts&amp;title=Angular%20Starter\" target=\"_blank\" rel=\"noopener\" title=\"\">solution in action on Stackblitz here<\/a>. We fixed our code and added some performance improvements as well by ensuring we can&#8217;t get into memory leaks and optimizing change detection for that component.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In yesterday&#8217;s code challenge, our application wasn&#8217;t displaying any data. There were two reasons for that problem: I&#8217;m including links to previous newsletter entries for deeper dives on the different topics involved in that solution. And there are quite a few subtleties to overcome. Let&#8217;s tackle the first issue, which was providing the HTTP client. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,40],"tags":[],"class_list":["post-1872","post","type-post","status-publish","format-standard","hentry","category-angular","category-code-challenge"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"In yesterday&#039;s code challenge, our application wasn&#039;t displaying any data. There were two reasons for that problem: HttpClient was not provided in the application The change detection strategy OnPush wasn&#039;t compatible with the data flow of the application I&#039;m including links to previous newsletter entries for deeper dives on the different topics involved in that\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Alain Chautard\"\/>\n\t<meta name=\"google-site-verification\" content=\"SXxD3jwe28P5x4KWwWlYlHobuesNDkT6VWG1oVG1GcQ\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/code-challenge-2-solution\\\/#article\",\"name\":\"Code challenge #2 Solution | Angular Newsletter\",\"headline\":\"Code challenge #2 Solution\",\"author\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/author\\\/alcfeoh\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/image-10.png\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/code-challenge-2-solution\\\/#articleImage\",\"width\":804,\"height\":100},\"datePublished\":\"2023-12-12T05:00:00-08:00\",\"dateModified\":\"2023-12-11T11:36:27-08:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/code-challenge-2-solution\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/code-challenge-2-solution\\\/#webpage\"},\"articleSection\":\"Angular, Code Challenge\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/code-challenge-2-solution\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/category\\\/angular\\\/#listItem\",\"name\":\"Angular\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/category\\\/angular\\\/#listItem\",\"position\":2,\"name\":\"Angular\",\"item\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/category\\\/angular\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/category\\\/angular\\\/code-challenge\\\/#listItem\",\"name\":\"Code Challenge\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/category\\\/angular\\\/code-challenge\\\/#listItem\",\"position\":3,\"name\":\"Code Challenge\",\"item\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/category\\\/angular\\\/code-challenge\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/code-challenge-2-solution\\\/#listItem\",\"name\":\"Code challenge #2 Solution\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/category\\\/angular\\\/#listItem\",\"name\":\"Angular\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/code-challenge-2-solution\\\/#listItem\",\"position\":4,\"name\":\"Code challenge #2 Solution\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/category\\\/angular\\\/code-challenge\\\/#listItem\",\"name\":\"Code Challenge\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/#organization\",\"name\":\"Angular Training\",\"description\":\"Tutorials and updates about the Angular framework\",\"url\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/\",\"email\":\"contact@interstate21.com\",\"telephone\":\"+14089106087\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/wp-content\\\/uploads\\\/2018\\\/01\\\/blue-logo-vertical.png\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/code-challenge-2-solution\\\/#organizationLogo\",\"width\":1234,\"height\":950},\"image\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/code-challenge-2-solution\\\/#organizationLogo\"},\"sameAs\":[\"https:\\\/\\\/www.youtube.com\\\/@AngularTraining\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/achautard\\\/\",\"https:\\\/\\\/blog.angulartraining.com\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/author\\\/alcfeoh\\\/#author\",\"url\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/author\\\/alcfeoh\\\/\",\"name\":\"Alain Chautard\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/code-challenge-2-solution\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/26ae8a75f090f33d4e79871307246008907228871b691f47cf15d2e7353939fd?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Alain Chautard\"},\"sameAs\":[\"https:\\\/\\\/twitter.com\\\/alainchautard\",\"https:\\\/\\\/www.youtube.com\\\/@AngularTraining\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/achautard\\\/\"]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/code-challenge-2-solution\\\/#webpage\",\"url\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/code-challenge-2-solution\\\/\",\"name\":\"Code challenge #2 Solution | Angular Newsletter\",\"description\":\"In yesterday's code challenge, our application wasn't displaying any data. There were two reasons for that problem: HttpClient was not provided in the application The change detection strategy OnPush wasn't compatible with the data flow of the application I'm including links to previous newsletter entries for deeper dives on the different topics involved in that\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/code-challenge-2-solution\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/author\\\/alcfeoh\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/author\\\/alcfeoh\\\/#author\"},\"datePublished\":\"2023-12-12T05:00:00-08:00\",\"dateModified\":\"2023-12-11T11:36:27-08:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/#website\",\"url\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/\",\"name\":\"Angular Newsletter\",\"description\":\"Tutorials and updates about the Angular framework\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Code challenge #2 Solution | Angular Newsletter","description":"In yesterday's code challenge, our application wasn't displaying any data. There were two reasons for that problem: HttpClient was not provided in the application The change detection strategy OnPush wasn't compatible with the data flow of the application I'm including links to previous newsletter entries for deeper dives on the different topics involved in that","canonical_url":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"google-site-verification":"SXxD3jwe28P5x4KWwWlYlHobuesNDkT6VWG1oVG1GcQ","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/#article","name":"Code challenge #2 Solution | Angular Newsletter","headline":"Code challenge #2 Solution","author":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/author\/alcfeoh\/#author"},"publisher":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2023\/12\/image-10.png","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/#articleImage","width":804,"height":100},"datePublished":"2023-12-12T05:00:00-08:00","dateModified":"2023-12-11T11:36:27-08:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/#webpage"},"isPartOf":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/#webpage"},"articleSection":"Angular, Code Challenge"},{"@type":"BreadcrumbList","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter#listItem","position":1,"name":"Home","item":"https:\/\/www.angulartraining.com\/daily-newsletter","nextItem":{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/angular\/#listItem","name":"Angular"}},{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/angular\/#listItem","position":2,"name":"Angular","item":"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/angular\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/angular\/code-challenge\/#listItem","name":"Code Challenge"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/angular\/code-challenge\/#listItem","position":3,"name":"Code Challenge","item":"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/angular\/code-challenge\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/#listItem","name":"Code challenge #2 Solution"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/angular\/#listItem","name":"Angular"}},{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/#listItem","position":4,"name":"Code challenge #2 Solution","previousItem":{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/angular\/code-challenge\/#listItem","name":"Code Challenge"}}]},{"@type":"Organization","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/#organization","name":"Angular Training","description":"Tutorials and updates about the Angular framework","url":"https:\/\/www.angulartraining.com\/daily-newsletter\/","email":"contact@interstate21.com","telephone":"+14089106087","logo":{"@type":"ImageObject","url":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2018\/01\/blue-logo-vertical.png","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/#organizationLogo","width":1234,"height":950},"image":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/#organizationLogo"},"sameAs":["https:\/\/www.youtube.com\/@AngularTraining","https:\/\/www.linkedin.com\/in\/achautard\/","https:\/\/blog.angulartraining.com\/"]},{"@type":"Person","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/author\/alcfeoh\/#author","url":"https:\/\/www.angulartraining.com\/daily-newsletter\/author\/alcfeoh\/","name":"Alain Chautard","image":{"@type":"ImageObject","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/26ae8a75f090f33d4e79871307246008907228871b691f47cf15d2e7353939fd?s=96&d=mm&r=g","width":96,"height":96,"caption":"Alain Chautard"},"sameAs":["https:\/\/twitter.com\/alainchautard","https:\/\/www.youtube.com\/@AngularTraining","https:\/\/www.linkedin.com\/in\/achautard\/"]},{"@type":"WebPage","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/#webpage","url":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/","name":"Code challenge #2 Solution | Angular Newsletter","description":"In yesterday's code challenge, our application wasn't displaying any data. There were two reasons for that problem: HttpClient was not provided in the application The change detection strategy OnPush wasn't compatible with the data flow of the application I'm including links to previous newsletter entries for deeper dives on the different topics involved in that","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/#website"},"breadcrumb":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/#breadcrumblist"},"author":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/author\/alcfeoh\/#author"},"creator":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/author\/alcfeoh\/#author"},"datePublished":"2023-12-12T05:00:00-08:00","dateModified":"2023-12-11T11:36:27-08:00"},{"@type":"WebSite","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/#website","url":"https:\/\/www.angulartraining.com\/daily-newsletter\/","name":"Angular Newsletter","description":"Tutorials and updates about the Angular framework","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/#organization"}}]}},"aioseo_meta_data":{"post_id":"1872","title":null,"description":null,"keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2023-12-11 19:18:06","updated":"2025-06-03 23:56:36","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/angular\/\" title=\"Angular\">Angular<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/angular\/code-challenge\/\" title=\"Code Challenge\">Code Challenge<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tCode challenge #2 Solution\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.angulartraining.com\/daily-newsletter"},{"label":"Angular","link":"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/angular\/"},{"label":"Code Challenge","link":"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/angular\/code-challenge\/"},{"label":"Code challenge #2 Solution","link":"https:\/\/www.angulartraining.com\/daily-newsletter\/code-challenge-2-solution\/"}],"_links":{"self":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/1872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/comments?post=1872"}],"version-history":[{"count":2,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/1872\/revisions"}],"predecessor-version":[{"id":1877,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/1872\/revisions\/1877"}],"wp:attachment":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/media?parent=1872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/categories?post=1872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/tags?post=1872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}