{"id":15358,"date":"2016-12-05T12:15:19","date_gmt":"2016-12-05T10:15:19","guid":{"rendered":"https:\/\/www.webcodegeeks.com\/?p=15358"},"modified":"2016-12-05T11:24:40","modified_gmt":"2016-12-05T09:24:40","slug":"angularjs-2-series-build-component","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/","title":{"rendered":"AngularJs 2 Series: Build Your Own Component"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>AngularJs 2 is a popular JavaScript framework to create Single Page Application (SPA). In a Single Page Application, upon client making the request the data fetched from the server or locally is rendered in the browser instantly without the page refresh. Only the area or part of the DOM, that needs to display the data, is changed. AngularJs 2 comes with wide variety of programming features like Component, Templates, Databinding, Http, Directives, Pipes, Forms, Dependency Injection, Services, Routing and many more. It uses Typescript as the native scripting language. Typescript is written on top of JavaScript and offers plenty of useful features which is otherwise not found in JavaScript. The final code is eventually compiled into JavaScript by the build tool. Typescript is also a strongly typed scripting language and enforces the use of types for every property declared. In this article I will demonstrate the use of AngularJs 2 Component feature.<\/p>\n<h2>Setting Up<\/h2>\n<p>We will use Angular CLI (Command Line Interface) to build the AngularJs 2 Component. AngularJs CLI provides \u2018ng\u2019 utility that can be used to setup and build the complete Angular project. There are various commands used with \u2018ng\u2019 tool to create different components or features of AngularJs application.<br \/>\nWe will install Node.js and use its <em>npm<\/em> utility to install Angular CLI. Download the latest version of Node.js from the <a href=\"https:\/\/nodejs.org\/en\/\">official site<\/a> and install the same. Once installed, open the Node.js command prompt and enter the following command to install Angular CLI:<\/p>\n<p><code>npm install -g angular-cli<\/code><\/p>\n<p>Once installed, navigate to the folder where you want to create the project and run the following command on the command prompt:<\/p>\n<p><code>ng new my-app<\/code><\/p>\n<p>This will create the new folder named my-app and different other files and sub-directories that will enable you to kick start with the development of AngularJs 2 application in this new project. The project can be created with the name of your choice. I am using my-app as the project name. Navigate to <code>my-app\\src\\app<\/code> folder. This is the folder where we will do lot of our action or coding work. As you see under the app folder, certain files are created and they have .ts extension which means they are Typescript files. We will ignore these files for the time being and move ahead in creating our first component. Before we deep dive into creating our first component, let\u2019s understand what is a component in AngularJs 2.<\/p>\n<h2>What is Component in AngularJs 2<\/h2>\n<p>The Component is an element on the web page. It is created as a Typescript class annotated or decorated with <code>@Component<\/code> decorator. Decorators in AngularJs 2 comprises of meta data that provides a specific meaning to the Typescript class. Components are typically used to display something on HTML page. It is therefore backed by what is called as template and styles. Template refers to HTML code fragment and styles refers to CSS styles. Styling is optional though. One more important meta data which every component must have is the selector. Selectors are custom HTML elements that is used to display the component. Component is identified by a selector for e.g. <strong>&lt;my-custom-component&gt;<\/strong>. This selector is used in HTML page to render the component.<\/p>\n<h2>Creating Item List Component<\/h2>\n<p>We will create a item list component that will display the list of items on a web page. Open the Node.js command prompt, navigate to my-app\\src\\app folder and run the following command:<\/p>\n<p><code>ng generate component item-list<\/code><\/p>\n<p>The above command will create the item-list component in the new folder named <code>item-list<\/code> and generate some files. Navigate to <code>item-list<\/code> folder and you will see four files generated:<\/p>\n<ul>\n<li><strong>item-list.component.ts<\/strong> \u2013 This is our main component class.<\/li>\n<li><strong>item-list.component.spec.ts<\/strong> \u2013 This is used for the purpose of testing (You can ignore for now as we are not discussing testing).<\/li>\n<li><strong>item-list.component.html<\/strong> \u2013 This is a template file for our component.<\/li>\n<li><strong>item-list.component.css<\/strong> \u2013 This will be the style sheet for our component.<\/li>\n<\/ul>\n<p>Lets look at the code in the file item-list.component.ts<\/p>\n<pre class=\"brush:php\">import { Component, OnInit } from '@angular\/core';\r\n\r\n@Component({\r\n  selector: 'app-item-list',\r\n  templateUrl: '.\/item-list.component.html',\r\n  styleUrls: ['.\/item-list.component.css']\r\n})\r\nexport class ItemListComponent implements OnInit {\r\n\r\n  constructor() { }\r\n\r\n  ngOnInit() {\r\n  }\r\n}<\/pre>\n<p>This is our main component class. Let\u2019s understand the structure of the class. As you can see the <code>@Component<\/code> decorator is used to indicate that this class is a component and it has an appropriate selector, template and style meta-data. By default, the selector generated is <code>app-item-list<\/code> but you can change it to the name of your choice. Just make sure the name does not clash with the native HTML element name. So you can\u2019t use names like <code>strong<\/code> or <code>li<\/code> or <code>h1<\/code> as these are reserved HTML element names. The next meta-data is the template URL which points to the template which is in this case is item-list.component.html and then we have style URLs that points to the CSS file. You can have more than one CSS files for a component. Note that providing style for your component is optional and it can be safely removed. For now our component does nothing but we will add value by creating list of items in a HTML template of this component.<\/p>\n<blockquote><p>The component class implements <code>OnInit<\/code> lifecycle interface. The component provides different lifecycle hooks (like <code>ngOnInit<\/code>, <code>ngOnChanges<\/code> and more) that can be used to capture lifecycle events.<\/p><\/blockquote>\n<h2>Creating Template<\/h2>\n<p>Open the file item-list.component.html and replace the existing code with the following HTML snippet:<\/p>\n<pre class=\"brush:xml\">&lt;h1&gt;Item List&lt;\/h1&gt;\r\n&lt;ul&gt;\r\n&lt;li&gt;Item 1&lt;\/li&gt;\r\n&lt;li&gt;Item 2&lt;\/li&gt;\r\n&lt;li&gt;Item 3&lt;\/li&gt;\r\n&lt;li&gt;Item 4&lt;\/li&gt;\r\n&lt;li&gt;Item 5&lt;\/li&gt;\r\n&lt;li&gt;Item 6&lt;\/li&gt;\r\n&lt;li&gt;Item 7&lt;\/li&gt;\r\n&lt;li&gt;Item 8&lt;\/li&gt;\r\n&lt;li&gt;Item 9&lt;\/li&gt;\r\n&lt;li&gt;Item 10&lt;\/li&gt;\r\n&lt;\/ul&gt;<\/pre>\n<p>All we are doing is displaying the list of items using &lt;li&gt; tag. Now that we have created the component we need to make sure that it is recognized by our application. Earlier when we created our project <code>my-app<\/code>, it created <strong>app.component.ts<\/strong> file which is the default bootstrap component. Bootstrap component is the starting component that the application launches. All other components that are created are called from this bootstrap component. So we will call our item-list component in the template file of the bootstrap component. In order to see the item list, you can place the component element (selector) <strong>&lt;app-item-list&gt;<\/strong> in the <strong>app.component.html<\/strong> template file which is part of the bootstrap component. The existing code can be replaced with the following:<\/p>\n<pre class=\"brush:php\">&lt;app-item-list&gt;&lt;\/app-item-list&gt;<\/pre>\n<p>You can use the built in development server provided by Angular CLI to run the application. Navigate to the project root folder <code>my-app<\/code> and run the following command:<\/p>\n<p><code>ng serve<\/code><\/p>\n<p>This will build your new <code>my-app<\/code> application and serve it on the port <em>4200<\/em>. Open the browser and point to <em>http:\/\/localhos:4200<\/em> and you should see your item list component displayed.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/techorgan.com\/javascript-framework\/angularjs-2-series-build-your-own-component\/\">AngularJs 2 Series: Build Your Own Component<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/join-us\/wcg\/\">WCG partner<\/a> Rajeev Hathi at the <a href=\"http:\/\/techorgan.com\/\">TECH ORGAN<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction AngularJs 2 is a popular JavaScript framework to create Single Page Application (SPA). In a Single Page Application, upon client making the request the data fetched from the server or locally is rendered in the browser instantly without the page refresh. Only the area or part of the DOM, that needs to display the &hellip;<\/p>\n","protected":false},"author":91,"featured_media":909,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-15358","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>AngularJs 2 Series: Build Your Own Component - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Introduction AngularJs 2 is a popular JavaScript framework to create Single Page Application (SPA). In a Single Page Application, upon client making the\" \/>\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\/angularjs-2-series-build-component\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AngularJs 2 Series: Build Your Own Component - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Introduction AngularJs 2 is a popular JavaScript framework to create Single Page Application (SPA). In a Single Page Application, upon client making the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/\" \/>\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:published_time\" content=\"2016-12-05T10:15:19+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=\"Rajeev Hathi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rajeev Hathi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 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\/angularjs-2-series-build-component\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/\"},\"author\":{\"name\":\"Rajeev Hathi\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/a31899e91ce8c7e23aa3835a86bc749f\"},\"headline\":\"AngularJs 2 Series: Build Your Own Component\",\"datePublished\":\"2016-12-05T10:15:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/\"},\"wordCount\":1071,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/#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\/angularjs-2-series-build-component\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/\",\"name\":\"AngularJs 2 Series: Build Your Own Component - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\",\"datePublished\":\"2016-12-05T10:15:19+00:00\",\"description\":\"Introduction AngularJs 2 is a popular JavaScript framework to create Single Page Application (SPA). In a Single Page Application, upon client making the\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/#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\/angularjs-2-series-build-component\/#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\":\"AngularJs 2 Series: Build Your Own Component\"}]},{\"@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\/a31899e91ce8c7e23aa3835a86bc749f\",\"name\":\"Rajeev Hathi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7b3d1f5c751db08d0cecf939d205a54df4f1e8925989025e169b55425423fe40?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7b3d1f5c751db08d0cecf939d205a54df4f1e8925989025e169b55425423fe40?s=96&d=mm&r=g\",\"caption\":\"Rajeev Hathi\"},\"description\":\"Rajeev is a senior Java architect and developer. He has been designing and developing business applications for various companies (both product and services). He is co-author of the book titled 'Apache CXF Web Service Development' and shares his technical knowledge through his blog platform techorgan.com\",\"sameAs\":[\"http:\/\/techorgan.com\/\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/rajeev-hathi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AngularJs 2 Series: Build Your Own Component - Web Code Geeks - 2026","description":"Introduction AngularJs 2 is a popular JavaScript framework to create Single Page Application (SPA). In a Single Page Application, upon client making the","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\/angularjs-2-series-build-component\/","og_locale":"en_US","og_type":"article","og_title":"AngularJs 2 Series: Build Your Own Component - Web Code Geeks - 2026","og_description":"Introduction AngularJs 2 is a popular JavaScript framework to create Single Page Application (SPA). In a Single Page Application, upon client making the","og_url":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2016-12-05T10:15:19+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":"Rajeev Hathi","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Rajeev Hathi","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/"},"author":{"name":"Rajeev Hathi","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/a31899e91ce8c7e23aa3835a86bc749f"},"headline":"AngularJs 2 Series: Build Your Own Component","datePublished":"2016-12-05T10:15:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/"},"wordCount":1071,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/#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\/angularjs-2-series-build-component\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/","url":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/","name":"AngularJs 2 Series: Build Your Own Component - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","datePublished":"2016-12-05T10:15:19+00:00","description":"Introduction AngularJs 2 is a popular JavaScript framework to create Single Page Application (SPA). In a Single Page Application, upon client making the","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/angularjs-2-series-build-component\/#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\/angularjs-2-series-build-component\/#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":"AngularJs 2 Series: Build Your Own Component"}]},{"@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\/a31899e91ce8c7e23aa3835a86bc749f","name":"Rajeev Hathi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7b3d1f5c751db08d0cecf939d205a54df4f1e8925989025e169b55425423fe40?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7b3d1f5c751db08d0cecf939d205a54df4f1e8925989025e169b55425423fe40?s=96&d=mm&r=g","caption":"Rajeev Hathi"},"description":"Rajeev is a senior Java architect and developer. He has been designing and developing business applications for various companies (both product and services). He is co-author of the book titled 'Apache CXF Web Service Development' and shares his technical knowledge through his blog platform techorgan.com","sameAs":["http:\/\/techorgan.com\/"],"url":"https:\/\/www.webcodegeeks.com\/author\/rajeev-hathi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/15358","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\/91"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=15358"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/15358\/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=15358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=15358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=15358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}