{"id":6389,"date":"2021-03-12T23:03:51","date_gmt":"2021-03-12T23:33:51","guid":{"rendered":"https:\/\/ultering.com\/it4us\/?p=6389"},"modified":"2023-07-06T15:27:12","modified_gmt":"2023-07-06T15:57:12","slug":"angular-from-scratch-tutorial-step-5","status":"publish","type":"post","link":"https:\/\/ultering.com\/it4us\/?p=6389","title":{"rendered":"Angular From Scratch Tutorial &#8211; Step 5: Directives"},"content":{"rendered":"<p><a href=\"https:\/\/ultering.com\/it4us\/?p=7175\">Angular From Scratch Tutorial &#8211; Index<\/a><\/p>\n<p><a href=\"https:\/\/ultering.com\/it4us\/?p=6198\">PREVIOUS: Angular From Scratch Tutorial \u2013 Step 4: Adding Bootstrap<\/a><\/p>\n<p><a href=\"https:\/\/ultering.com\/it4us\/?p=6426\">NEXT: Angular From Scratch Tutorial &#8211; Step 6: Dependency Injection and <\/a><a href=\"https:\/\/ultering.com\/it4us\/?p=6426\">Service <\/a><\/p>\n<h2><\/h2>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 counter-hierarchy ez-toc-counter ez-toc-white ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a1ab8f9cba27\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a1ab8f9cba27\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ultering.com\/it4us\/?p=6389\/#TARGET\" >TARGET<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ultering.com\/it4us\/?p=6389\/#Source_CodeDownload\" >Source Code\/Download<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ultering.com\/it4us\/?p=6389\/#What_are_directives\" >What are directives?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ultering.com\/it4us\/?p=6389\/#Types_of_directives\" >Types of directives<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ultering.com\/it4us\/?p=6389\/#1_Built-in_directives\" >1. Built-in directives.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ultering.com\/it4us\/?p=6389\/#2_Attribute_directives\" >2. Attribute directives<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ultering.com\/it4us\/?p=6389\/#3_Structural_Directives\" >3. Structural Directives<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ultering.com\/it4us\/?p=6389\/#NEXT\" >NEXT<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ultering.com\/it4us\/?p=6389\/#Credits\" >Credits<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"TARGET\"><\/span>TARGET<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The purpose of this page in this tutorial series is to provide a very fast approach that is useful for revisions when you have already dealt with Angular, but after an absense of using it, it turns necessary to do a &#8220;disk swap&#8221; bringing from &#8220;disk&#8221; to your &#8220;memory&#8221; again. \ud83d\ude42<\/p>\n<p>If it is your first Angular approach, or you are a newbie, it is recommended to go first to the Angular&#8217;s documentation. After, this page will serve you as a summary for fast referencing and revision.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Source_CodeDownload\"><\/span>Source Code\/Download<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>For more details, the source code may be found on <a href=\"https:\/\/github.com\/alsdias\/afsTutorial\">GitHub<\/a>, &#8220;step3&#8221; tag (includes step1 up to step3).<\/p>\n<h2><span class=\"ez-toc-section\" id=\"What_are_directives\"><\/span>What are directives?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Directives are the building blocks of angular applications.<br \/>\nEvery time you see or use something like <code>&lt;my-app&gt;<\/code>\u00a0or\u00a0<code>&lt;div *my-directive&gt;<\/code>, you are using some form of an Angular directive.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Types_of_directives\"><\/span>Types of directives<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"1_Built-in_directives\"><\/span>1. Built-in directives.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Those that comes with the native code, APIs, libraries.<br \/>\nEx.: ngFor, ngIf, etc.<br \/>\nGo to <a href=\"https:\/\/angular.io\/guide\/built-in-directives\">angular.io\/guide\/built-in-directives<\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Attribute_directives\"><\/span>2. Attribute directives<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><em>Attribute directives<\/em>\u00a0alter the appearance or behavior of an existing element.<br \/>\nEx.: ngModel examined on previous step (<a href=\"https:\/\/ultering.com\/it4us\/?p=6198\">step4<\/a>).<br \/>\nThe perfect page to get the grips is\u00a0<a href=\"https:\/\/angular.io\/guide\/attribute-directives\">angular.io\/guide\/attribute-directives.<\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_Structural_Directives\"><\/span>3. Structural Directives<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Go to <a href=\"https:\/\/angular.io\/guide\/structural-directives\">angular.io\/guide\/structural-directives<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"NEXT\"><\/span>NEXT<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a href=\"https:\/\/ultering.com\/it4us\/?p=7175\">Angular From Scratch Tutorial &#8211; Index<\/a><\/p>\n<p><a href=\"https:\/\/ultering.com\/it4us\/?p=6426\">NEXT: Angular From Scratch Tutorial &#8211; Step 6: Dependency Injection and <\/a><a href=\"https:\/\/ultering.com\/it4us\/?p=6426\">Service <\/a><\/p>\n<p><a href=\"https:\/\/ultering.com\/it4us\/?p=6198\">PREVIOUS: Angular From Scratch Tutorial &#8211; Step 4: Adding Bootstrap<\/a><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Credits\"><\/span>Credits<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a href=\"https:\/\/angular.io\/guide\/attribute-directives\">angular.io\/guide\/attribute-directives<\/a><br \/>\n<span class=\"ng-star-inserted\"><a title=\"live example\" href=\"https:\/\/angular.io\/generated\/live-examples\/attribute-directives\/stackblitz.html\" target=\"_blank\" rel=\"noopener\">live example<\/a>\u00a0\/\u00a0<a title=\"Download example\" href=\"https:\/\/angular.io\/generated\/zips\/attribute-directives\/attribute-directives.zip\" download=\"\">download example<\/a><br \/>\n<a href=\"https:\/\/angular.io\/guide\/built-in-directives\">angular.io\/guide\/built-in-directives<\/a><br \/>\n<a href=\"https:\/\/angular.io\/guide\/structural-directives\">angular.io\/guide\/structural-directives<\/a><br \/>\n<a href=\"https:\/\/angular.io\/guide\/attribute-directives\">angular.io\/guide\/attribute-directives.<\/a><br \/>\n<\/span><\/p>\n<!--CusAds0-->\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Angular From Scratch Tutorial &#8211; Index PREVIOUS: Angular From Scratch Tutorial \u2013 Step 4: Adding Bootstrap NEXT: Angular From Scratch Tutorial &#8211; Step 6: Dependency Injection and Service TARGET The purpose of this page in this tutorial series is to provide a very fast approach that is useful for revisions when you have already dealt &#8230; <a href=\"https:\/\/ultering.com\/it4us\/?p=6389\" class=\"more-link\">Read More<span class=\"screen-reader-text\"> &#8220;Angular From Scratch Tutorial &#8211; Step 5: Directives&#8221;<\/span> &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[192,26],"tags":[],"class_list":["post-6389","post","type-post","status-publish","format-standard","hentry","category-angular","category-javascript"],"_links":{"self":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/6389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6389"}],"version-history":[{"count":6,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/6389\/revisions"}],"predecessor-version":[{"id":7183,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/6389\/revisions\/7183"}],"wp:attachment":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}