{"id":2027,"date":"2024-04-03T16:36:51","date_gmt":"2024-04-03T23:36:51","guid":{"rendered":"https:\/\/www.angulartraining.com\/daily-newsletter\/?p=2027"},"modified":"2024-04-03T16:36:52","modified_gmt":"2024-04-03T23:36:52","slug":"understanding-angular-typescript-types","status":"publish","type":"post","link":"https:\/\/www.angulartraining.com\/daily-newsletter\/understanding-angular-typescript-types\/","title":{"rendered":"Understanding Angular\/Typescript types"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">First, some news: I&#8217;m running a <a href=\"https:\/\/courses.angulartraining.com\/course\/fundamentals-angular\" target=\"_blank\" rel=\"noopener\" title=\"\">public 5 half-day online Angular class<\/a> during the week of April 22nd. It&#8217;s the perfect class if you&#8217;re new to Angular or have some experience and want to ensure you know about all the fundamentals. It&#8217;s the ideal class to prepare for the <a href=\"https:\/\/courses.angulartraining.com\/course\/angular-level-1-certification-exam\" target=\"_blank\" rel=\"noopener\" title=\"\">Angular Level 1 certification<\/a> exam.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On a side note, I can give private talks for your company or dev team on any topic, including Signals, the future of Angular, and more. Just email me for more info if you&#8217;d like to get such a talk planned in the future.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Today, I want to cover a tricky topic for many developers I interact with: Reading and understanding Typescript type definitions from the Angular framework.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For instance, let&#8217;s look at the type definition of the <a href=\"https:\/\/angular.io\/api\/router\/CanActivateFn\" target=\"_blank\" rel=\"noopener\" title=\"\"><code>canActivate<\/code> function<\/a>:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"625\" height=\"88\" src=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image.png\" alt=\"\" class=\"wp-image-2028\" srcset=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image.png 625w, https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image-300x42.png 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can tell <code>CanActivateFn<\/code> is a function because:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The Angular team uses the <code>Fn<\/code> suffix as a convention for all functions<\/li>\n\n\n\n<li>The type signature is <code>( params ) =&gt; returnType<\/code>, which is how TypeScript defines types for functions. The arrow symbol <code>=&gt;<\/code> is key there.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">So, in that case, the function has two parameters, <code>route<\/code> of type <code>ActivatedRouteSnapshot<\/code>, and <code>state<\/code> of type <code>RouterStateSnapshot<\/code>. The function returns a type <code>MaybeAsync&lt;GuardResult><\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is what the type definition of <code><a href=\"https:\/\/angular.io\/api\/router\/MaybeAsync\" target=\"_blank\" rel=\"noopener\" title=\"\">MaybeAsync<\/a><\/code> looks like:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"593\" height=\"47\" src=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image-1.png\" alt=\"\" class=\"wp-image-2029\" srcset=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image-1.png 593w, https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image-1-300x24.png 300w\" sizes=\"auto, (max-width: 593px) 100vw, 593px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What does that mean? <code>MaybeAsync&lt;T><\/code> is a generic type, which means it works with any number of types, referred to as <code>T<\/code> here. You can see <code>T<\/code> as a type variable that gets replaced with an actual value decided when we use that type. For instance, if I end up using <code>MaybeAsync<\/code> on a <code>string<\/code>, <code>T<\/code> becomes <code>string<\/code>, and our type definition means:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>type MaybeAsync&lt;string&gt; = string | Observable&lt;string&gt; | Promise&lt;string&gt;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So <code>MaybeAsync&lt;string&gt;<\/code> can be either a <code>string<\/code>, an <code>Observable<\/code> that will return a <code>string<\/code>, or a <code>Promise<\/code> that will return a <code>string<\/code>. That&#8217;s because the | character defines a <a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/union-types-in-typescript\/\" target=\"_blank\" rel=\"noopener\" title=\"\">union type<\/a> and can be seen as a logical OR. In other words: <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>MaybeAsync&lt;string&gt; IS A string OR Observable&lt;string&gt; OR Promise&lt;string&gt;<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, in the case of our <code>CanActivate<\/code> function, the return type is <code>MaybeAsync&lt;GuardResult&gt;<\/code>. On <a href=\"https:\/\/angular.io\/\" target=\"_blank\" rel=\"noopener\" title=\"\">angular.io<\/a>, most types are clickable (a lot less on <a href=\"https:\/\/angular.dev\/\" target=\"_blank\" rel=\"noopener\" title=\"\">angular.dev<\/a> for now). If I click on <code><a href=\"https:\/\/angular.io\/api\/router\/GuardResult\" target=\"_blank\" rel=\"noopener\" title=\"\">GuardResult<\/a><\/code> on <a href=\"https:\/\/angular.io\/api\/router\/CanActivateFn\" target=\"_blank\" rel=\"noopener\" title=\"\">this page<\/a>, I get to the following documentation entry:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"421\" height=\"55\" src=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image-2.png\" alt=\"\" class=\"wp-image-2030\" srcset=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image-2.png 421w, https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image-2-300x39.png 300w\" sizes=\"auto, (max-width: 421px) 100vw, 421px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">So a <code>GuardResult<\/code> is either a <code>boolean<\/code> or a <code>UrlTree<\/code>. This tells us that a <code>CanActivate<\/code> function can return six possible different types:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a <code>boolean<\/code>, an <code>Observable<\/code> of a <code>boolean<\/code>, a <code>Promise<\/code> of a <code>boolean<\/code><\/li>\n\n\n\n<li>a <code>UrlTree<\/code>, an <code>Observable<\/code> of a <code>UrlTree<\/code>, a <code>Promise<\/code> of a <code>UrlTree<\/code>.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In the past, the <a href=\"https:\/\/v15.angular.io\/api\/router\/CanActivateFn\" target=\"_blank\" rel=\"noopener\" title=\"\">documentation would list the six types inline<\/a> as follows, which is the same thing but a little harder to read. Additional types have been added in Angular 16 to improve the readability of such framework APIs:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"912\" height=\"92\" src=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image-3.png\" alt=\"\" class=\"wp-image-2031\" srcset=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image-3.png 912w, https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image-3-300x30.png 300w, https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image-3-768x77.png 768w\" sizes=\"auto, (max-width: 912px) 100vw, 912px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another tricky thing with types is that several features of the Angular framework support different options, resulting in multiple types of signatures. You can look at the <a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/rxjs-and-signals-interoperability\/\" target=\"_blank\" rel=\"noopener\" title=\"\">toSignal<\/a> function for such an example &#8211; there are <a href=\"https:\/\/angular.io\/api\/core\/rxjs-interop\/toSignal#overloads\" target=\"_blank\" rel=\"noopener\" title=\"\">5 different overloads<\/a> in that function signature, the most basic one being:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"743\" height=\"63\" src=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image-4.png\" alt=\"\" class=\"wp-image-2035\" srcset=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image-4.png 743w, https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2024\/04\/image-4-300x25.png 300w\" sizes=\"auto, (max-width: 743px) 100vw, 743px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As an exercise, I invite you to examine <a href=\"https:\/\/angular.io\/api\/core\/rxjs-interop\/toSignal#overloads\" target=\"_blank\" rel=\"noopener\" title=\"\">the 5 overloads<\/a> and try to understand where they come from and why they make sense.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you encounter any other tricky type you can&#8217;t decipher, please send it my way, and I&#8217;ll be happy to cover it in a future newsletter entry.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First, some news: I&#8217;m running a public 5 half-day online Angular class during the week of April 22nd. It&#8217;s the perfect class if you&#8217;re new to Angular or have some experience and want to ensure you know about all the fundamentals. It&#8217;s the ideal class to prepare for the Angular Level 1 certification exam. On [&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,3],"tags":[],"class_list":["post-2027","post","type-post","status-publish","format-standard","hentry","category-angular","category-typescript"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"First, some news: I&#039;m running a public 5 half-day online Angular class during the week of April 22nd. It&#039;s the perfect class if you&#039;re new to Angular or have some experience and want to ensure you know about all the fundamentals. It&#039;s the ideal class to prepare for the Angular Level 1 certification exam. On\" \/>\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\/understanding-angular-typescript-types\/\" \/>\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\\\/understanding-angular-typescript-types\\\/#article\",\"name\":\"Understanding Angular\\\/Typescript types | Angular Newsletter\",\"headline\":\"Understanding Angular\\\/Typescript types\",\"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\\\/2024\\\/04\\\/image.png\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/understanding-angular-typescript-types\\\/#articleImage\",\"width\":625,\"height\":88},\"datePublished\":\"2024-04-03T16:36:51-07:00\",\"dateModified\":\"2024-04-03T16:36:52-07:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/understanding-angular-typescript-types\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/understanding-angular-typescript-types\\\/#webpage\"},\"articleSection\":\"Angular, TypeScript\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/understanding-angular-typescript-types\\\/#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\\\/typescript\\\/#listItem\",\"name\":\"TypeScript\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/category\\\/typescript\\\/#listItem\",\"position\":2,\"name\":\"TypeScript\",\"item\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/category\\\/typescript\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/understanding-angular-typescript-types\\\/#listItem\",\"name\":\"Understanding Angular\\\/Typescript types\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/understanding-angular-typescript-types\\\/#listItem\",\"position\":3,\"name\":\"Understanding Angular\\\/Typescript types\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/category\\\/typescript\\\/#listItem\",\"name\":\"TypeScript\"}}]},{\"@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\\\/understanding-angular-typescript-types\\\/#organizationLogo\",\"width\":1234,\"height\":950},\"image\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/understanding-angular-typescript-types\\\/#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\\\/understanding-angular-typescript-types\\\/#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\\\/understanding-angular-typescript-types\\\/#webpage\",\"url\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/understanding-angular-typescript-types\\\/\",\"name\":\"Understanding Angular\\\/Typescript types | Angular Newsletter\",\"description\":\"First, some news: I'm running a public 5 half-day online Angular class during the week of April 22nd. It's the perfect class if you're new to Angular or have some experience and want to ensure you know about all the fundamentals. It's the ideal class to prepare for the Angular Level 1 certification exam. On\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/understanding-angular-typescript-types\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/author\\\/alcfeoh\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.angulartraining.com\\\/daily-newsletter\\\/author\\\/alcfeoh\\\/#author\"},\"datePublished\":\"2024-04-03T16:36:51-07:00\",\"dateModified\":\"2024-04-03T16:36:52-07: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":"Understanding Angular\/Typescript types | Angular Newsletter","description":"First, some news: I'm running a public 5 half-day online Angular class during the week of April 22nd. It's the perfect class if you're new to Angular or have some experience and want to ensure you know about all the fundamentals. It's the ideal class to prepare for the Angular Level 1 certification exam. On","canonical_url":"https:\/\/www.angulartraining.com\/daily-newsletter\/understanding-angular-typescript-types\/","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\/understanding-angular-typescript-types\/#article","name":"Understanding Angular\/Typescript types | Angular Newsletter","headline":"Understanding Angular\/Typescript types","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\/2024\/04\/image.png","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/understanding-angular-typescript-types\/#articleImage","width":625,"height":88},"datePublished":"2024-04-03T16:36:51-07:00","dateModified":"2024-04-03T16:36:52-07:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/understanding-angular-typescript-types\/#webpage"},"isPartOf":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/understanding-angular-typescript-types\/#webpage"},"articleSection":"Angular, TypeScript"},{"@type":"BreadcrumbList","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/understanding-angular-typescript-types\/#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\/typescript\/#listItem","name":"TypeScript"}},{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/typescript\/#listItem","position":2,"name":"TypeScript","item":"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/typescript\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/understanding-angular-typescript-types\/#listItem","name":"Understanding Angular\/Typescript types"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/understanding-angular-typescript-types\/#listItem","position":3,"name":"Understanding Angular\/Typescript types","previousItem":{"@type":"ListItem","@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/typescript\/#listItem","name":"TypeScript"}}]},{"@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\/understanding-angular-typescript-types\/#organizationLogo","width":1234,"height":950},"image":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/understanding-angular-typescript-types\/#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\/understanding-angular-typescript-types\/#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\/understanding-angular-typescript-types\/#webpage","url":"https:\/\/www.angulartraining.com\/daily-newsletter\/understanding-angular-typescript-types\/","name":"Understanding Angular\/Typescript types | Angular Newsletter","description":"First, some news: I'm running a public 5 half-day online Angular class during the week of April 22nd. It's the perfect class if you're new to Angular or have some experience and want to ensure you know about all the fundamentals. It's the ideal class to prepare for the Angular Level 1 certification exam. On","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/#website"},"breadcrumb":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/understanding-angular-typescript-types\/#breadcrumblist"},"author":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/author\/alcfeoh\/#author"},"creator":{"@id":"https:\/\/www.angulartraining.com\/daily-newsletter\/author\/alcfeoh\/#author"},"datePublished":"2024-04-03T16:36:51-07:00","dateModified":"2024-04-03T16:36:52-07: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":"2027","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":"2024-04-02 22:30:58","updated":"2025-06-03 23:59:31","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\/typescript\/\" title=\"TypeScript\">TypeScript<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tUnderstanding Angular\/Typescript types\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.angulartraining.com\/daily-newsletter"},{"label":"TypeScript","link":"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/typescript\/"},{"label":"Understanding Angular\/Typescript types","link":"https:\/\/www.angulartraining.com\/daily-newsletter\/understanding-angular-typescript-types\/"}],"_links":{"self":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/2027","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=2027"}],"version-history":[{"count":6,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/2027\/revisions"}],"predecessor-version":[{"id":2038,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/2027\/revisions\/2038"}],"wp:attachment":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/media?parent=2027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/categories?post=2027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/tags?post=2027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}