{"id":14495,"date":"2016-08-29T16:15:32","date_gmt":"2016-08-29T13:15:32","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=14495"},"modified":"2017-12-19T16:22:39","modified_gmt":"2017-12-19T14:22:39","slug":"angular-js-components-example","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/","title":{"rendered":"Angular.js Components Example"},"content":{"rendered":"<p>One of the most powerful features in AngularJS are directives, what with them marking a DOM element so that it behaves a certain way. However, properly using and constructing them would give us a more robust application, as directives are essential in creating flexible Javascript and template code for our app.<\/p>\n<p>With the feature-set that AngularJS has to offer, we can construct robust and flexible directives in our application by treating directives as if they are standalone, isolated components. Let&#8217;s see how can we go from directives to components in order to make app-miracles happen.<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n[ulp id=&#8217;LXJcMJZXSsqGXYW8&#8242;]<\/p>\n<h2>1. What are components?<\/h2>\n<p>Why are we, all of a sudden calling directives by the name components? They&#8217;re not the same thing, not exactly. A directive is a feature all by itself, while a component is a piece of code that can be plugged into another body of code and be expected to behave as we want it to. To put it simply, a directive is a component that works off of the inputs given and it can be used in any template anywhere and uses a simpler configuration which is suitable for a component-based application structure.<\/p>\n<p>By definition, an AngularJS Component is a special kind of directive that uses a simpler configuration, suitable for a component-based application structure. This way we have it remarkably easier to write an app in a way similar to using Web Components, or Angular 2&#8217;s style of application structure. Like everything else, it has a number of advantages and also disadvantages. Let&#8217;s see them one by one!<\/p>\n<h3>1.1 Advantages of Components<\/h3>\n<p>Components are recently gaining so much momentum for a number of reasons. One of the most important ones is that components are easier than plain directives to get configured. They are under the wing of q number of programmers because they promote best practices and default pieces of code that make life easier for a lot of us. Components are optimized for the emerging application architecture that is heavily based on components, and using them will make the transition to Angular 2 much more seamless.<\/p>\n<h3>1.2 Disadvantages of Components<\/h3>\n<p>There are, however, some cases when the usage of Components is not recommended. These include: directives that rely on DOM manipulation and adding event listeners, since the compile and link functions are unavailable. Another example of when not to use Components would be when you need advanced directive definition options like priority, terminal, multi-element or when you want a directive that is triggered by an attribute or CSS class, rather than an element. Nonetheless, if you correctly pick your battles and use Components as a feature of your app, it could make you all-powerful.<\/p>\n<h2>2. Creating and configuring a Component<\/h2>\n<p>Even though people are talking about components a lot lately, most of the existing Angular code in the world is still not component-based. Components didn&#8217;t become widespread until quite recently, and many of us are working with apps that have several years of history behind them. The foundations for these codebases were laid way before components were added to our collective toolbox. Nonetheless, it is quite easy to create and configure Components, and the basis for that is the method <code>.component()<\/code>.<\/p>\n<p>But what is the role of <code>.component()<\/code>? This method is a simple one that takes two arguments: the name of the Component as a string and the config object, which distinctly from <code>.directive()<\/code>, cannot be a factory function. <code>.component()<\/code>&#8216;s main role is to declare new HTML via a <code>template<\/code> or <code>templateUrl<\/code>, and it&#8217;s to be used as a creator of Components in a component-based architecture. For more, let&#8217;s see them in action!<\/p>\n<p>Components, even though they might be classified as a special case of directives, can&#8217;t be more than elements. That means they are restricted <code>'E'<\/code> and this is not optional. The code snippet below shows us how the HTML part of our code would go:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>index.html<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;!doctype html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n    &lt;meta charset=\"UTF-8\"&gt;\r\n    &lt;title&gt;Angular Components&lt;\/title&gt;\r\n\r\n\r\n    &lt;script src=\"\/\/ajax.googleapis.com\/ajax\/libs\/angularjs\/1.5.8\/angular.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"index.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"eraDetail.js\"&gt;&lt;\/script&gt;\r\n\r\n\r\n\r\n&lt;\/head&gt;\r\n&lt;body ng-app=\"ourApp\"&gt;\r\n\r\n&lt;div ng-controller=\"MainCtrl as ctrl\"&gt;\r\n    &lt;b&gt;Me&lt;\/b&gt;&lt;br&gt;\r\n    &lt;era-detail era=\"ctrl.era\"&gt;&lt;\/era-detail&gt;\r\n&lt;\/div&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>It&#8217;s mostly a standard structure of a main HTML document, where we notice at a first glance, that we have scripted two Javascript files, named <code>index.js<\/code> and <code>eraDetail.js<\/code>, both of which contain code parts that we will explain later on in more detail. Then, we notice that the whole body section of our document is made into an Angular app, named <code>ourApp<\/code>. After that we see that we have a div managed by the controller <code>MainCtrl<\/code>, inside of which we have placed an HTML document which appears to have been named <code>&lt;era-detail&gt;<\/code>. What is this element that we&#8217;ve never seen before? This, ladies and gents, is our component!<\/p>\n<p>But what does this component do, what do it&#8217;s responsibilities entail? Take a look at the code below:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>eraDetail.html<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;span&gt;Name: {{$ctrl.era.name}}&lt;\/span&gt;\r\n<\/pre>\n<p>This line of code, which you&#8217;ll notice that we have placed in a separate HTML file, is all what our Component as a DOM element will include. That is, a simple span element with an Angular binding expression, which will make more sense after we take a look at the Javascript part of our app. so let&#8217;s get right to it, then:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>index.js<\/em><\/span><\/p>\n<pre class=\"brush:js\">(function(angular) {\r\n  'use strict';\r\nangular.module('ourApp', []).controller('MainCtrl', function MainCtrl() {\r\n  this.era = {\r\n    name: 'Era'\r\n  };\r\n});\r\n})(window.angular);\r\n<\/pre>\n<p>By using this piece of code, we have created an Angular module named <code>ourApp<\/code>, as you&#8217;ll remember from the first file we showed you. Right after that we have created a controller named <code>MainCtrl<\/code>, which contains a simple object named <code>era<\/code>, which has an attribute called <code>name<\/code> withe the given value <code>Era<\/code>. See anything familiar? Yes, it is the same variable you see in the binding of the component&#8217;s content file. But this is not all, as we need to do the configuration of the Component. We have placed that code into a separate file, which you&#8217;ve seen scripted into the main HMTL file. It&#8217;s contents would look like below:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>eraDetail.js<\/em><\/span><\/p>\n<pre class=\"brush:js\">(function(angular) {\r\n  'use strict';\r\nfunction EraDetailController() {\r\n\r\n}\r\n\r\nangular.module('ourApp').component('eraDetail', {\r\n  templateUrl: 'eraDetail.html',\r\n  controller: EraDetailController,\r\n  bindings: {\r\n    era: '='\r\n  }\r\n});\r\n})(window.angular);\r\n<\/pre>\n<p>With this piece of code we create and configure our component. You seen that we have used the <code>component()<\/code> method, with it&#8217;s first argument the name of our Component. Even though you see it here as <code>eraDetail<\/code>, you use it as <code>&lt;era-detail&gt;<\/code> in the main HTML file, because Angular does the conversion of the cases on it&#8217;s own. The second argument to the <code>component()<\/code> method would be the config object. We use <code>templateUrl<\/code>, which would contain the path to the file containing the contents of our Component. Also, our component should have it&#8217;s own controller, in our case named as <code>EraDetailController<\/code> and lastly, special bindings. With this, we now have a fully functioning Angular component, ready to use and reuse according to our needs.<\/p>\n<h2>3. Components Vs. Directives<\/h2>\n<p>As Components are a honorary special case of directives, there are many similarities and differences between both of them. Let&#8217;s count some of them out!<\/p>\n<p>First, while directives do not allow bindings, Controllers do, and bind to the controller. On the other hand, Directives do have <code>bindToController<\/code>, while for components, you&#8217;d have to perform this using regular bindings. Another main difference is that while directives have compile functions, components do not, which is one of the reasons we can&#8217;t use directives when adding event listeners, or when we have to do with elements that require DOM manipulation. The same goes for link functions.<\/p>\n<p>While restriction of usage is one of the key elements for the configuration of directives, this is invalid for components since we are aware from the get-go that we can only use them as elements. We use <code>template<\/code> and <code>templateUrl<\/code> with both of them, however with Components, they&#8217;re also injectable.<\/p>\n<h2>4. Download the source code<\/h2>\n<p>This was an example of Angular Components.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here:\u00a0<strong><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/08\/Components.zip\">Components<\/a><\/strong><\/div>\n","protected":false},"excerpt":{"rendered":"<p>One of the most powerful features in AngularJS are directives, what with them marking a DOM element so that it behaves a certain way. However, properly using and constructing them would give us a more robust application, as directives are essential in creating flexible Javascript and template code for our app. With the feature-set that &hellip;<\/p>\n","protected":false},"author":25,"featured_media":909,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-14495","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-angular-js"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Angular.js Components Example - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"One of the most powerful features in AngularJS are directives, what with them marking a DOM element so that it behaves a certain way. However, properly\" \/>\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.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Angular.js Components Example - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"One of the most powerful features in AngularJS are directives, what with them marking a DOM element so that it behaves a certain way. However, properly\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/era.balliu.7\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-29T13:15:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-19T14:22:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Era Balliu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@BalliuEra\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Era Balliu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/\"},\"author\":{\"name\":\"Era Balliu\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/c27ecf40c810e6396ba93ffb829c7b0e\"},\"headline\":\"Angular.js Components Example\",\"datePublished\":\"2016-08-29T13:15:32+00:00\",\"dateModified\":\"2017-12-19T14:22:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/\"},\"wordCount\":1262,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\",\"articleSection\":[\"Angular.js\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/\",\"name\":\"Angular.js Components Example - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\",\"datePublished\":\"2016-08-29T13:15:32+00:00\",\"dateModified\":\"2017-12-19T14:22:39+00:00\",\"description\":\"One of the most powerful features in AngularJS are directives, what with them marking a DOM element so that it behaves a certain way. However, properly\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Angular.js\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/angular-js\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Angular.js Components Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/c27ecf40c810e6396ba93ffb829c7b0e\",\"name\":\"Era Balliu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f6adddf7eada210f682608fea9d8159441369ec622998a5851a447e0a2bfa3f3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f6adddf7eada210f682608fea9d8159441369ec622998a5851a447e0a2bfa3f3?s=96&d=mm&r=g\",\"caption\":\"Era Balliu\"},\"description\":\"Era is a Telecommunications Engineering student, with a great passion for new technologies. Up until now she has been coding with HTML\/CSS, Bootstrap and other front-end coding languages and frameworks, and her recent love is Angular JS.\",\"sameAs\":[\"http:\/\/www.webcodegeeks.com\/\",\"https:\/\/www.facebook.com\/era.balliu.7\",\"https:\/\/www.instagram.com\/eraballiu\/\",\"https:\/\/www.linkedin.com\/in\/eraballiu\",\"https:\/\/www.pinterest.com\/001r2gw0jt0ln6d\/\",\"https:\/\/x.com\/BalliuEra\",\"https:\/\/www.youtube.com\/c\/eraballiu\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/era-balliu\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Angular.js Components Example - Web Code Geeks - 2026","description":"One of the most powerful features in AngularJS are directives, what with them marking a DOM element so that it behaves a certain way. However, properly","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.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/","og_locale":"en_US","og_type":"article","og_title":"Angular.js Components Example - Web Code Geeks - 2026","og_description":"One of the most powerful features in AngularJS are directives, what with them marking a DOM element so that it behaves a certain way. However, properly","og_url":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_author":"https:\/\/www.facebook.com\/era.balliu.7","article_published_time":"2016-08-29T13:15:32+00:00","article_modified_time":"2017-12-19T14:22:39+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","type":"image\/jpeg"}],"author":"Era Balliu","twitter_card":"summary_large_image","twitter_creator":"@BalliuEra","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Era Balliu","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/"},"author":{"name":"Era Balliu","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/c27ecf40c810e6396ba93ffb829c7b0e"},"headline":"Angular.js Components Example","datePublished":"2016-08-29T13:15:32+00:00","dateModified":"2017-12-19T14:22:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/"},"wordCount":1262,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","articleSection":["Angular.js"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/","url":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/","name":"Angular.js Components Example - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","datePublished":"2016-08-29T13:15:32+00:00","dateModified":"2017-12-19T14:22:39+00:00","description":"One of the most powerful features in AngularJS are directives, what with them marking a DOM element so that it behaves a certain way. However, properly","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angular-js-components-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/"},{"@type":"ListItem","position":3,"name":"Angular.js","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/angular-js\/"},{"@type":"ListItem","position":4,"name":"Angular.js Components Example"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/c27ecf40c810e6396ba93ffb829c7b0e","name":"Era Balliu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f6adddf7eada210f682608fea9d8159441369ec622998a5851a447e0a2bfa3f3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f6adddf7eada210f682608fea9d8159441369ec622998a5851a447e0a2bfa3f3?s=96&d=mm&r=g","caption":"Era Balliu"},"description":"Era is a Telecommunications Engineering student, with a great passion for new technologies. Up until now she has been coding with HTML\/CSS, Bootstrap and other front-end coding languages and frameworks, and her recent love is Angular JS.","sameAs":["http:\/\/www.webcodegeeks.com\/","https:\/\/www.facebook.com\/era.balliu.7","https:\/\/www.instagram.com\/eraballiu\/","https:\/\/www.linkedin.com\/in\/eraballiu","https:\/\/www.pinterest.com\/001r2gw0jt0ln6d\/","https:\/\/x.com\/BalliuEra","https:\/\/www.youtube.com\/c\/eraballiu"],"url":"https:\/\/www.webcodegeeks.com\/author\/era-balliu\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/14495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=14495"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/14495\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/909"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=14495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=14495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=14495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}