{"id":732,"date":"2016-03-02T08:02:58","date_gmt":"2016-03-02T07:02:58","guid":{"rendered":"http:\/\/blog.thecodecampus.de\/?p=732"},"modified":"2023-12-20T19:59:57","modified_gmt":"2023-12-20T18:59:57","slug":"angular-1-5-multi-slot-transclusion","status":"publish","type":"post","link":"https:\/\/www.thecodecampus.de\/blog\/angular-1-5-multi-slot-transclusion\/","title":{"rendered":"Angular 1.5 Multi Slot Transclusion"},"content":{"rendered":"<h1>Angular 1.5 Multi Slot Transclusion<\/h1>\n<p>Transclusion is one of the most useful features when it comes to writing reusable Angular directives. Even if you never heard of what it is, you might have used transclusion before without knowing it. The version 1.5 of AngularJS adds a long awaited\u00a0feature: Multi Slot Transclusion, that allows us developer to build ever more flexible API&#8217;s for our directives.<\/p>\n<p>I&#8217;m not going through the whole concept of\u00a0transclusion, there are a lot of posts in the internet (see Chapter &#8216;Further Reading&#8217;) that cover this\u00a0topic.<\/p>\n<p>&nbsp;<\/p>\n<h2>Classic Transclusion in Angular 1.4 and below<\/h2>\n<p>typically you would use transclusion to let the user of your directive insert his custom HTML into your directive.<\/p>\n<p>Given you have a markup such as the following:<\/p>\n<pre class=\"lang:xhtml decode:true\" title=\"Markup of 2 nested directives\">&lt;list&gt;\r\n   &lt;list-item title=\"Football\"&gt;is cool&lt;\/list-item&gt;\r\n   &lt;list-item title=\"Table Tennis\"&gt;rocks&lt;\/list-item&gt;\r\n   &lt;list-item title=\"Football Table\"&gt;is the best&lt;\/list-item&gt;\r\n&lt;\/list&gt;<\/pre>\n<p>and two directive definitions like<\/p>\n<pre class=\"lang:js decode:true\" title=\"Directive definition from template above\">app.directive('list', function() {\r\n  return {\r\n    restrict: 'AE',\r\n    scope: {},\r\n    transclude: true,\r\n    replace: true,\r\n    template: '&lt;ul ng-transclude&gt;&lt;\/ul&gt;'\r\n  }\r\n});\r\n\r\napp.directive('listItem', function() {\r\n  return {\r\n    restrict: 'AE',\r\n    require: '^list',\r\n    scope: {\r\n      title: '@'\r\n    },\r\n    transclude: true,\r\n    replace: true,\r\n    template:'&lt;li&gt;&lt;\/span&gt;&lt;b&gt;{{title}}: &lt;\/b&gt;&lt;span ng-transclude&gt;&lt;\/span&gt;&lt;\/span&gt;&lt;\/li&gt;'\r\n  } \r\n});<\/pre>\n<p>The two directives <code>list<\/code> and <code>list-item<\/code> render the following snippet:<br \/>\n<iframe loading=\"lazy\" width=\"100%\" height=\"250\" src=\"http:\/\/embed.plnkr.co\/QjOPN05x5RYx2kqhZ7mJ\/\"><\/iframe><\/p>\n<h2>The Problem<\/h2>\n<p>Typically you start to run into limitations pretty soon. Lets imagine you want to create a directive similar to the example above:<\/p>\n<ul>\n<li>show the\u00a0title of a <code>list-item<\/code><\/li>\n<li>display either a icon as a css-class or a <code>img<\/code>-tag on the left<\/li>\n<li>show some textual <code>content<\/code><\/li>\n<\/ul>\n<p>of course you could implement this by introducing one or two more directives and start nesting them inside each other, but in this case lets imagine we want to stick with only the two existing directives <code>list<\/code> and <code>list-item<\/code><\/p>\n<h2>The Solution<\/h2>\n<p>Multi Slot Transclusion is here to help deal with this kind of scenarios. With very little modifications to the directives created above we can easily add the desired behavior. IMHO the readability of the new directive we&#8217;re about to create is improved greatly compared to classic transclusion &#8211; especially from the point of view of a consumer of the directive.<\/p>\n<pre class=\"lang:default decode:true\" title=\"Using Multi Slot Transclusion\">&lt;list&gt;\r\n   &lt;list-item title=\"Football\"&gt;\r\n      &lt;icon&gt;\r\n         &lt;img src=\"http:\/\/placehold.it\/200x150\"&gt;\r\n      &lt;\/icon&gt;\r\n      &lt;content&gt;is cool&lt;\/content&gt;\r\n   &lt;\/list-item&gt;\r\n   &lt;list-item title=\"Table Tennis\"&gt;&lt;\/list-item&gt;\r\n   &lt;list-item title=\"Football Table\"&gt;\r\n      &lt;content&gt;is the best&lt;\/content&gt;\r\n      &lt;icon class=\"glyphicon glyphicon-thumbs-up\"&gt;&lt;\/icon&gt;\r\n   &lt;\/list-item&gt;\r\n&lt;\/list&gt;<\/pre>\n<p>As you can see we added a few more lines of code we&#8217;re about to cover now:<\/p>\n<p>in line 2-6 we define a <code>list-item<\/code> that still has an attribute <code>title=\"Football\"<\/code> as it has before. The additions we made start to appear inside the <code>list-item<\/code>-tags where we added two more elements.<br \/>\nOn the one hand we added a <code>content<\/code> element that was the content in the first example that was transcluded in the <code>list-item<\/code> directive. We now have a more semantical way of expressing what kind of HTML is transcluded here.<br \/>\nOn the other hand there is a <code>icon<\/code> element that shall represent our image\/icon that we want to display on the left of the list. As we can see this element can have its own HTML elements inside the <code>icon<\/code>-tags. In this example a placeholder image.<br \/>\nWhats important to note here is that the order of the elements inside the <code>list-item<\/code> does not matter. What matters is the name of the elements inside it.<\/p>\n<p>How does Angular know where to place the transcluded content you might wonder.<\/p>\n<pre class=\"lang:js decode:true\" title=\"Multi Slot Transclusion directive definition\">app.directive('listItem', function() {\r\n  return {\r\n    restrict: 'AE',\r\n    require: '^list',\r\n    scope: {\r\n      title: '@'\r\n    },\r\n    transclude: {\r\n       'contentSlot': '?content', \/\/a '?' indicates an optional slot\r\n       'iconSlot': '?icon'        \/\/a error gets thrown if a required slot is unavailable\r\n    },\r\n    replace: true,\r\n    template:\r\n    '&lt;li&gt;' +\r\n      '&lt;span ng-transclude=\"iconSlot\"&gt;&lt;\/span&gt;' + \/\/iconSlot gets transcluded here\r\n      '&lt;span&gt;'+\r\n        '&lt;b&gt;{{title}}: &lt;\/b&gt;' +\r\n        '&lt;span ng-transclude=\"contentSlot\"&gt;This is a default&lt;\/span&gt;' + \/\/content gets transcluded here\r\n      '&lt;\/span&gt;' +\r\n    '&lt;\/li&gt;'\r\n  } \r\n});<\/pre>\n<p>Again we made minor adjustments to the directive from the first example. Mainly we redefined the <code>transclude<\/code>-property of the directive definition. Where we previously just wrote <code>transclude: true<\/code> we can now specify an object. The key (left part of the key-value) of the object is the name that is used internally in this directive to let angular know where we want the transcluded content to be inserted. you can see this in the <code>template<\/code> definition of the directive. In line 15 we say<br \/>\n<code>&lt;span ng-transclude=\"iconSlot\"&gt;&lt;\/span&gt;<\/code> and tell angular to insert the icon here.<br \/>\nsame applies for the contentSlot, that gets inserted in line 18.<\/p>\n<p>So the key of the transclude key-value is the internal name of the HTML-snippet. So whats the value then? We already saw what it is. The value is the name of the element in the template that uses our <code>list-item<\/code> directive.<\/p>\n<pre class=\"lang:default decode:true\" title=\"\">&lt;list&gt;\r\n   &lt;list-item title=\"Football Table\"&gt;\r\n      &lt;content&gt;is the best&lt;\/content&gt;\r\n   &lt;\/list-item&gt;\r\n&lt;\/list&gt;<\/pre>\n<p>the <code>content<\/code>-element is the name that is used in the directive&#8217;s transclusion definition: <code>transclude: {'contentSlot': 'content'}<\/code><br \/>\nThats all the magic that happens.<\/p>\n<p>A few More thing to note are:<\/p>\n<ul>\n<li>classic transclusion still works the way it always did. An upgrade to Angular 1.5 wont break your application, but gives you the opportunity to use Multi Slot Transclusion.<\/li>\n<li>you can use ng-transclude-slot as an alias for ng-transclude<\/li>\n<li>you can use ng-transclude as an attribute and an element<\/li>\n<li>you can specify default transclusion content, take a look at the directive definition in our 2nd example<\/li>\n<\/ul>\n<p>If you want to, you can take a look at this Plunkr and play a little with it, to get familiar with the newly introduces syntax.<br \/>\n<iframe loading=\"lazy\" width=\"100%\" height=\"500\" src=\"http:\/\/embed.plnkr.co\/LsAQLM2g574M9yMTTqno\/\"><\/iframe><\/p>\n<h2 id=\"further_reading\">Further Reading<\/h2>\n<ol>\n<li><a href=\"http:\/\/teropa.info\/blog\/2015\/06\/09\/transclusion.html\" target=\"_blank\" rel=\"noopener\">Transclusion explained<\/a><\/li>\n<li><a href=\"http:\/\/plnkr.co\/edit\/QjOPN05x5RYx2kqhZ7mJ?p=preview\" target=\"_blank\" rel=\"noopener\">Classic AngularJS Transclusion<\/a><\/li>\n<li><a href=\"http:\/\/plnkr.co\/edit\/LsAQLM2g574M9yMTTqno?p=preview\" target=\"_blank\" rel=\"noopener\">AngularJS 1.5 Multi Slot Transclusion<\/a><\/li>\n<li><a href=\"https:\/\/docs.angularjs.org\/api\/ng\/directive\/ngTransclude\" target=\"_blank\" rel=\"noopener\">AngularJS Docs about Transclusion<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/15296284\/understanding-the-transclude-option-of-directive-definition\" target=\"_blank\" rel=\"noopener\">Stackoverflow discussion about transclusion<\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Angular 1.5 Multi Slot Transclusion Transclusion is one of the most useful features when it comes to writing reusable Angular directives. Even if you never heard of what it is, you might have used transclusion before without knowing it. The version 1.5 of AngularJS adds a long awaited\u00a0feature: Multi Slot Transclusion, that allows us developer [&#8230;]<br \/><a class=\"meta-big\" href=\"https:\/\/www.thecodecampus.de\/blog\/angular-1-5-multi-slot-transclusion\/\"> READ MORE<\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,2],"tags":[64,62,68,69,67,66,65],"class_list":["post-732","post","type-post","status-publish","format-standard","hentry","category-angularjs","category-javascript","tag-angular-1-5","tag-angularjs","tag-directive","tag-multi-slot","tag-scope","tag-transclude","tag-transclusion"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Angular 1.5 Multi Slot Transclusion - Web Development Blog<\/title>\n<meta name=\"description\" content=\"This article shows how to implement a basic multi slot transclusion directive in Angular 1.5, it uses a Plunkr and explaines how transclusion works.\" \/>\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\/angular-1-5-multi-slot-transclusion\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Angular 1.5 Multi Slot Transclusion - Web Development Blog\" \/>\n<meta property=\"og:description\" content=\"This article shows how to implement a basic multi slot transclusion directive in Angular 1.5, it uses a Plunkr and explaines how transclusion works.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.thecodecampus.de\/blog\/angular-1-5-multi-slot-transclusion\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Development tips and tricks - theCodeCampus Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-03-02T07:02:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-20T18:59:57+00:00\" \/>\n<meta name=\"author\" content=\"Kai Henzler\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kai Henzler\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-1-5-multi-slot-transclusion\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-1-5-multi-slot-transclusion\\\/\"},\"author\":{\"name\":\"Kai Henzler\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/person\\\/b9decc610011ed03b2117b5e02032132\"},\"headline\":\"Angular 1.5 Multi Slot Transclusion\",\"datePublished\":\"2016-03-02T07:02:58+00:00\",\"dateModified\":\"2023-12-20T18:59:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-1-5-multi-slot-transclusion\\\/\"},\"wordCount\":734,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\"},\"keywords\":[\"Angular 1.5\",\"AngularJS\",\"Directive\",\"Multi-Slot\",\"Scope\",\"Transclude\",\"Transclusion\"],\"articleSection\":[\"AngularJS 1\",\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-1-5-multi-slot-transclusion\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-1-5-multi-slot-transclusion\\\/\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-1-5-multi-slot-transclusion\\\/\",\"name\":\"Angular 1.5 Multi Slot Transclusion - Web Development Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#website\"},\"datePublished\":\"2016-03-02T07:02:58+00:00\",\"dateModified\":\"2023-12-20T18:59:57+00:00\",\"description\":\"This article shows how to implement a basic multi slot transclusion directive in Angular 1.5, it uses a Plunkr and explaines how transclusion works.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-1-5-multi-slot-transclusion\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-1-5-multi-slot-transclusion\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/angular-1-5-multi-slot-transclusion\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Angular 1.5 Multi Slot Transclusion\"}]},{\"@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\\\/b9decc610011ed03b2117b5e02032132\",\"name\":\"Kai Henzler\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/kai-henzler-tcc-author-96x96.webp\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/kai-henzler-tcc-author-96x96.webp\",\"contentUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/kai-henzler-tcc-author-96x96.webp\",\"caption\":\"Kai Henzler\"},\"description\":\"I'm a web developer who is around since the AngularJS days (10+ years). My focus is on teaching others how to write simple and maintainable code.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/kai-henzler-58484599\\\/\"],\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/author\\\/khenzler\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Angular 1.5 Multi Slot Transclusion - Web Development Blog","description":"This article shows how to implement a basic multi slot transclusion directive in Angular 1.5, it uses a Plunkr and explaines how transclusion works.","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\/angular-1-5-multi-slot-transclusion\/","og_locale":"en_US","og_type":"article","og_title":"Angular 1.5 Multi Slot Transclusion - Web Development Blog","og_description":"This article shows how to implement a basic multi slot transclusion directive in Angular 1.5, it uses a Plunkr and explaines how transclusion works.","og_url":"https:\/\/www.thecodecampus.de\/blog\/angular-1-5-multi-slot-transclusion\/","og_site_name":"Web Development tips and tricks - theCodeCampus Blog","article_published_time":"2016-03-02T07:02:58+00:00","article_modified_time":"2023-12-20T18:59:57+00:00","author":"Kai Henzler","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kai Henzler","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.thecodecampus.de\/blog\/angular-1-5-multi-slot-transclusion\/#article","isPartOf":{"@id":"https:\/\/www.thecodecampus.de\/blog\/angular-1-5-multi-slot-transclusion\/"},"author":{"name":"Kai Henzler","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/person\/b9decc610011ed03b2117b5e02032132"},"headline":"Angular 1.5 Multi Slot Transclusion","datePublished":"2016-03-02T07:02:58+00:00","dateModified":"2023-12-20T18:59:57+00:00","mainEntityOfPage":{"@id":"https:\/\/www.thecodecampus.de\/blog\/angular-1-5-multi-slot-transclusion\/"},"wordCount":734,"commentCount":0,"publisher":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#organization"},"keywords":["Angular 1.5","AngularJS","Directive","Multi-Slot","Scope","Transclude","Transclusion"],"articleSection":["AngularJS 1","JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.thecodecampus.de\/blog\/angular-1-5-multi-slot-transclusion\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.thecodecampus.de\/blog\/angular-1-5-multi-slot-transclusion\/","url":"https:\/\/www.thecodecampus.de\/blog\/angular-1-5-multi-slot-transclusion\/","name":"Angular 1.5 Multi Slot Transclusion - Web Development Blog","isPartOf":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#website"},"datePublished":"2016-03-02T07:02:58+00:00","dateModified":"2023-12-20T18:59:57+00:00","description":"This article shows how to implement a basic multi slot transclusion directive in Angular 1.5, it uses a Plunkr and explaines how transclusion works.","breadcrumb":{"@id":"https:\/\/www.thecodecampus.de\/blog\/angular-1-5-multi-slot-transclusion\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.thecodecampus.de\/blog\/angular-1-5-multi-slot-transclusion\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.thecodecampus.de\/blog\/angular-1-5-multi-slot-transclusion\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.thecodecampus.de\/blog\/"},{"@type":"ListItem","position":2,"name":"Angular 1.5 Multi Slot Transclusion"}]},{"@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\/b9decc610011ed03b2117b5e02032132","name":"Kai Henzler","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/06\/kai-henzler-tcc-author-96x96.webp","url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/06\/kai-henzler-tcc-author-96x96.webp","contentUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/06\/kai-henzler-tcc-author-96x96.webp","caption":"Kai Henzler"},"description":"I'm a web developer who is around since the AngularJS days (10+ years). My focus is on teaching others how to write simple and maintainable code.","sameAs":["https:\/\/www.linkedin.com\/in\/kai-henzler-58484599\/"],"url":"https:\/\/www.thecodecampus.de\/blog\/author\/khenzler\/"}]}},"_links":{"self":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/732","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\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/comments?post=732"}],"version-history":[{"count":15,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/732\/revisions"}],"predecessor-version":[{"id":2720,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/732\/revisions\/2720"}],"wp:attachment":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/media?parent=732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/categories?post=732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/tags?post=732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}