{"id":2357,"date":"2018-09-02T14:41:42","date_gmt":"2018-09-02T12:41:42","guid":{"rendered":"https:\/\/www.angulararchitects.io\/?p=2357"},"modified":"2018-09-02T14:41:42","modified_gmt":"2018-09-02T12:41:42","slug":"upgrading-with-web-components-from-angularjs-to-angular","status":"publish","type":"post","link":"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/","title":{"rendered":"Upgrading with Web Components: From AngularJS to Angular"},"content":{"rendered":"<div class=\"article\">\n<p>Upgrading from AngularJS to Angular can be challenging. Framework-independent Web Components can help here. Fortunately, Angular now allows exposing Web Components and beginning with AngularJS 1.7.3 you can easily consume them.<\/p>\n<p>To be more precise, we should use the word Custom Elements instead of Web Components as Web Components is an umbrella term for several standards. According to <a href=\"https:\/\/custom-elements-everywhere.com\/\">https:\/\/custom-elements-everywhere.com\/<\/a>, they really work well with AngularJS:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i.imgur.com\/tV5k0at.png\" alt=\"AngularJS seamlessly works together w\/ Custom Elements\" width=\"100%\"><\/p>\n<p>In this post, I show how to use this for migrating an AngularJS solution step by step to Angular. For this, I write new application parts with Angular and provide them as Custom Elements which are loaded into the AngularJS context:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i.imgur.com\/deAVg3V.png\" alt=\"Sample for upgrading\" width=\"100%\"><\/p>\n<p>You can tell by the logos and the dashed lines where the AngularJS and where the Angular parts are.<\/p>\n<p>The <a href=\"https:\/\/github.com\/manfredsteyer\/angularjs_ce\">source code<\/a> can be found in my <a href=\"https:\/\/github.com\/manfredsteyer\/angularjs_ce\">GitHub account<\/a>.<\/p>\n<h2 id=\"project-structure\">Project Structure<\/h2>\n<p>The advantage of this approach is, that one doesn't need to intermingle AngularJS and Angular code. Instead, both parts of the application are written separately and the integration happens at runtime when a bundle with Custom elements is loaded.<\/p>\n<p>Hence, when you look at the folder structure of my example, you will find an own folder for each of those parts:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i.imgur.com\/qikW6Kj.png\" alt=\"Folder Structure\" width=\"100%\"><\/p>\n<h2 id=\"angular-part\">Angular Part<\/h2>\n<p>The Angular folder contains this component displaying a flight as shown above:<\/p>\n<pre class=\"hljs\"><code><div><span class=\"hljs-meta\">@Component<\/span>({\n    templateUrl: <span class=\"hljs-string\">'.\/flight-card.component.html'<\/span>\n})\n<span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-keyword\">class<\/span> FlightCardComponent <span class=\"hljs-keyword\">implements<\/span> OnChanges {\n    <span class=\"hljs-meta\">@Input<\/span>() item: <span class=\"hljs-built_in\">any<\/span>;\n    <span class=\"hljs-meta\">@Input<\/span>() selected: <span class=\"hljs-built_in\">boolean<\/span>;\n    <span class=\"hljs-meta\">@Output<\/span>() selectedChange = <span class=\"hljs-keyword\">new<\/span> EventEmitter&lt;<span class=\"hljs-built_in\">boolean<\/span>&gt;();\n\n    deactivate(): <span class=\"hljs-built_in\">void<\/span> {\n        <span class=\"hljs-comment\">\/\/ this.selected = false;<\/span>\n        <span class=\"hljs-keyword\">this<\/span>.selectedChange.emit(<span class=\"hljs-literal\">false<\/span>);\n    }\n\n    activate(): <span class=\"hljs-built_in\">void<\/span> {\n        <span class=\"hljs-comment\">\/\/ this.selected = true;<\/span>\n        <span class=\"hljs-keyword\">this<\/span>.selectedChange.emit(<span class=\"hljs-literal\">true<\/span>);\n    }\n\n}\n<\/div><\/code><\/pre>\n<p>This component is exposed as an external web component in its module:<\/p>\n<pre class=\"hljs\"><code><div><span class=\"hljs-keyword\">import<\/span> { createCustomElement } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'@angular\/elements'<\/span>;\n\n[...]\n\n<span class=\"hljs-meta\">@NgModule<\/span>({\n   imports: [\n      BrowserModule\n   ],\n   declarations: [\n    FlightCardComponent\n   ],\n   bootstrap: [],\n   entryComponents: [\n    FlightCardComponent\n   ]\n})\n<span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-keyword\">class<\/span> AppModule { \n\n    <span class=\"hljs-keyword\">constructor<\/span>(<span class=\"hljs-params\"><span class=\"hljs-keyword\">private<\/span> injector: Injector<\/span>) {\n    }\n\n    ngDoBootstrap() {\n        <span class=\"hljs-keyword\">const<\/span> flightCardCE = createCustomElement(FlightCardComponent, { injector: <span class=\"hljs-keyword\">this<\/span>.injector });\n\n        customElements.define(<span class=\"hljs-string\">'flight-card'<\/span>, flightCardCE);\n    }\n\n}\n<\/div><\/code><\/pre>\n<p>As you see here, the component is not only declared but also put into the module's <code>entryComponents<\/code> section. This is because Angular Element instantiates it dynamically at runtime.<\/p>\n<p>In <code>ngDoBootstrap<\/code> which is called during bootstrapping the Angular application, <code>createCustomElement<\/code> wraps it as a Custom Element and <code>customElements.define<\/code> registers it with the browser.<\/p>\n<p>As you see in this example, when wrapping the component the current injector is passed. Hence, the component can make use of dependency injection. As Angular Element's father, Rob Wormald, pointed out in <a href=\"https:\/\/youtu.be\/Z1gLFPLVJjY\">his talk at ngConf 2018<\/a>, this also allows different web components provided by the same application to communicate with each other using services.<\/p>\n<p>To make sure it works with every browser, I'm using the the polyfill <a href=\"https:\/\/www.npmjs.com\/package\/@webcomponents\/custom-elements\">@webcomponents\/custom-elements<\/a>.<\/p>\n<p><a href=\"https:\/\/www.angulararchitects.io\/post\/2018\/07\/13\/angular-elements-part-i-a-dynamic-dashboard-in-four-steps-with-web-components.aspx\">Further information<\/a> about using this polyfill, you can find in <a href=\"https:\/\/www.angulararchitects.io\/post\/2018\/07\/13\/angular-elements-part-i-a-dynamic-dashboard-in-four-steps-with-web-components.aspx\">my blog article series regarding Angular Elements<\/a>.<\/p>\n<p>To provide the AngularJS application with the bundles, the example uses a simple npm script copying it over using the <code>cpr<\/code> nodejs package:<\/p>\n<pre><code>\"build\": \"npm run bundle:ce &amp;&amp; npm run copy:ce\",\n\"copy:ce\": \"cpr dist\/demo ..\/angularjs\/angular-ce -d\",\n\"bundle:ce\": \"ng build --prod --output-hashing none\"\n<\/code><\/pre>\n<h2 id=\"angularjs-part\">AngularJS part<\/h2>\n<p>The AngularJS application references both, the AngularJS bundle as well as the bundles from the Angular part:<\/p>\n<pre class=\"hljs\"><code><div><span class=\"hljs-comment\">&lt;!-- Bundles for Angular part --&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\/javascript\"<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"angular-ce\/runtime.js\"<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\/javascript\"<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"angular-ce\/polyfills.js\"<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\/javascript\"<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"angular-ce\/scripts.js\"<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\/javascript\"<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"angular-ce\/main.js\"<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span>\n\n<span class=\"hljs-comment\">&lt;!-- Bundles for AngularJS part --&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"main.js\"<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span>\n<\/div><\/code><\/pre>\n<p>As it also references the polyfills bundle and the scripts bundle from the Angular part, we get the mentioned polyfills too.<\/p>\n<p>After this, you can use the Custom Element within the AngularJS templates:<\/p>\n<pre class=\"hljs\"><code><div><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">ng-repeat<\/span>=<span class=\"hljs-string\">\"b in $ctrl.bookings\"<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">flight-card<\/span> <span class=\"hljs-attr\">ng-prop-item<\/span>=<span class=\"hljs-string\">\"b\"<\/span> <span class=\"hljs-attr\">ng-prop-selected<\/span>=<span class=\"hljs-string\">\"$ctrl.selection[b.id]\"<\/span> <span class=\"hljs-attr\">ng-on-selected_change<\/span>=<span class=\"hljs-string\">\"$ctrl.change(b, $event)\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">flight-card<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n<\/div><\/code><\/pre>\n<p>Please have a look at the new directives <code>ng-prop-*<\/code> and <code>ng-on-*<\/code> which have been introduced with AngularJS 1.7.3. They allow to bind any property and any event of an (custom) element. Please also note, that the name <code>selectedChange<\/code> becomes <code>selected_change<\/code> here which is due to a convention of those directives.<\/p>\n<h2 id=\"exposing-angularjs-components-as-custom-elements\">Exposing AngularJS components as Custom Elements<\/h2>\n<p>Ok, so far we've seen how to expose an Angular Element as an Custom Element which can be used in an AngularJS application. But what's with the other way round? Is is also possible to wrap an AngularJS component as an Custom Element?<\/p>\n<p>Well, while there is not an official solution for this, no one can prevent you from manually wrapping AngularJS stuff. I'm using this technique in my showcase for <a href=\"https:\/\/www.angulararchitects.io\/post\/2018\/08\/19\/angular-react-vue-js-and-co-peacefully-united-thanks-to-micro-apps-and-web-components.aspx\">combinding several technologies by means of Web Components<\/a>:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i.imgur.com\/aObhafR.png\" alt=\"Micro App\" width=\"100%\"><\/p>\n<p>As described in <a href=\"https:\/\/www.angulararchitects.io\/post\/2018\/08\/19\/angular-react-vue-js-and-co-peacefully-united-thanks-to-micro-apps-and-web-components.aspx\">my article about this<\/a>, this example consists of an Angular application -- the shell -- which loads Micro Apps provided as Web Components on demand. One of those Micro Apps is the AngularJS based booking app shown above.<\/p>\n<p>The <a href=\"https:\/\/github.com\/manfredsteyer\/Angular_MicroApps_Different_Technologies\">full source code for this micro apps example<\/a> can be found <a href=\"https:\/\/github.com\/manfredsteyer\/Angular_MicroApps_Different_Technologies\">here<\/a>.<\/p>\n<h2 id=\"conclusion-and-evaluation\">Conclusion and Evaluation<\/h2>\n<p>Thanks to the Angular(JS) team's great support for Custom Elements, using this modern technique for migrating from AngularJS to Angular is straight forward: Just write the Angular parts in an new Angular solution and integrate them into the existing AngularJS counterpart by leveraging Custom Elements. Due to the newly introduced <code>ng-prop-*<\/code> and <code>ng-on-*<\/code> calling them within AngularJS is just a piece of cake.<\/p>\n<p>After every building block of the AngularJS part has been replaced by such a Custom Element, you can fully switch to Angular.<\/p>\n<p>One advantage over using <code>ngUpgrade<\/code> is that the Angular and the AngularJS parts are not intermingled which reduces complexity. However, <code>ngUpgrade<\/code> on the other side is more powerful. It not only allows using Angular components within AngularJS applications but also using AngularJS components within Angular applications without the need to wrap them by hand. Also, it allows mutual access to services on both sides.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Upgrading from AngularJS to Angular can be challenging. Framework-independent Web Components can help here. Fortunately, Angular now allows exposing Web Components and beginning with AngularJS 1.7.3 you can easily consume them. To be more precise, we should use the word Custom Elements instead of Web Components as Web Components is an umbrella term for several [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":3010,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2357","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-unkategorisiert"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Upgrading with Web Components: From AngularJS to Angular - ANGULARarchitects<\/title>\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.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Upgrading with Web Components: From AngularJS to Angular - ANGULARarchitects\" \/>\n<meta property=\"og:description\" content=\"Upgrading from AngularJS to Angular can be challenging. Framework-independent Web Components can help here. Fortunately, Angular now allows exposing Web Components and beginning with AngularJS 1.7.3 you can easily consume them. To be more precise, we should use the word Custom Elements instead of Web Components as Web Components is an umbrella term for several [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/\" \/>\n<meta property=\"og:site_name\" content=\"ANGULARarchitects\" \/>\n<meta property=\"article:published_time\" content=\"2018-09-02T12:41:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2018\/09\/upgrading-with-web-components-from-angularjs-to-angular.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1551\" \/>\n\t<meta property=\"og:image:height\" content=\"776\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Manfred Steyer, GDE\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@daniel\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Manfred Steyer, GDE\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/\"},\"author\":{\"name\":\"Manfred Steyer, GDE\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/15628efa7af4475ffaaeeb26c5112951\"},\"headline\":\"Upgrading with Web Components: From AngularJS to Angular\",\"datePublished\":\"2018-09-02T12:41:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/\"},\"wordCount\":783,\"publisher\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2018\/09\/upgrading-with-web-components-from-angularjs-to-angular.png\",\"articleSection\":[\"Unkategorisiert\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/\",\"url\":\"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/\",\"name\":\"Upgrading with Web Components: From AngularJS to Angular - ANGULARarchitects\",\"isPartOf\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2018\/09\/upgrading-with-web-components-from-angularjs-to-angular.png\",\"datePublished\":\"2018-09-02T12:41:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/#primaryimage\",\"url\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2018\/09\/upgrading-with-web-components-from-angularjs-to-angular.png\",\"contentUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2018\/09\/upgrading-with-web-components-from-angularjs-to-angular.png\",\"width\":1551,\"height\":776},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.angulararchitects.io\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Upgrading with Web Components: From AngularJS to Angular\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#website\",\"url\":\"https:\/\/www.angulararchitects.io\/en\/\",\"name\":\"ANGULARarchitects\",\"description\":\"AngularArchitects.io\",\"publisher\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.angulararchitects.io\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#organization\",\"name\":\"ANGULARarchitects\",\"alternateName\":\"SOFTWAREarchitects\",\"url\":\"https:\/\/www.angulararchitects.io\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg\",\"contentUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg\",\"width\":644,\"height\":216,\"caption\":\"ANGULARarchitects\"},\"image\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/github.com\/angular-architects\",\"https:\/\/www.linkedin.com\/company\/angular-architects\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/15628efa7af4475ffaaeeb26c5112951\",\"name\":\"Manfred Steyer, GDE\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a0b59539674d8b71ea1c1f4764b11244b5f499203f1d11b40f37d8f3f90be033?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a0b59539674d8b71ea1c1f4764b11244b5f499203f1d11b40f37d8f3f90be033?s=96&d=mm&r=g\",\"caption\":\"Manfred Steyer, GDE\"},\"sameAs\":[\"https:\/\/x.com\/daniel\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Upgrading with Web Components: From AngularJS to Angular - ANGULARarchitects","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.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/","og_locale":"en_US","og_type":"article","og_title":"Upgrading with Web Components: From AngularJS to Angular - ANGULARarchitects","og_description":"Upgrading from AngularJS to Angular can be challenging. Framework-independent Web Components can help here. Fortunately, Angular now allows exposing Web Components and beginning with AngularJS 1.7.3 you can easily consume them. To be more precise, we should use the word Custom Elements instead of Web Components as Web Components is an umbrella term for several [&hellip;]","og_url":"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/","og_site_name":"ANGULARarchitects","article_published_time":"2018-09-02T12:41:42+00:00","og_image":[{"width":1551,"height":776,"url":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2018\/09\/upgrading-with-web-components-from-angularjs-to-angular.png","type":"image\/png"}],"author":"Manfred Steyer, GDE","twitter_card":"summary_large_image","twitter_creator":"@daniel","twitter_misc":{"Written by":"Manfred Steyer, GDE","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/#article","isPartOf":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/"},"author":{"name":"Manfred Steyer, GDE","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/15628efa7af4475ffaaeeb26c5112951"},"headline":"Upgrading with Web Components: From AngularJS to Angular","datePublished":"2018-09-02T12:41:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/"},"wordCount":783,"publisher":{"@id":"https:\/\/www.angulararchitects.io\/en\/#organization"},"image":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/#primaryimage"},"thumbnailUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2018\/09\/upgrading-with-web-components-from-angularjs-to-angular.png","articleSection":["Unkategorisiert"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/","url":"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/","name":"Upgrading with Web Components: From AngularJS to Angular - ANGULARarchitects","isPartOf":{"@id":"https:\/\/www.angulararchitects.io\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/#primaryimage"},"image":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/#primaryimage"},"thumbnailUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2018\/09\/upgrading-with-web-components-from-angularjs-to-angular.png","datePublished":"2018-09-02T12:41:42+00:00","breadcrumb":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/#primaryimage","url":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2018\/09\/upgrading-with-web-components-from-angularjs-to-angular.png","contentUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2018\/09\/upgrading-with-web-components-from-angularjs-to-angular.png","width":1551,"height":776},{"@type":"BreadcrumbList","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/upgrading-with-web-components-from-angularjs-to-angular\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.angulararchitects.io\/en\/"},{"@type":"ListItem","position":2,"name":"Upgrading with Web Components: From AngularJS to Angular"}]},{"@type":"WebSite","@id":"https:\/\/www.angulararchitects.io\/en\/#website","url":"https:\/\/www.angulararchitects.io\/en\/","name":"ANGULARarchitects","description":"AngularArchitects.io","publisher":{"@id":"https:\/\/www.angulararchitects.io\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.angulararchitects.io\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.angulararchitects.io\/en\/#organization","name":"ANGULARarchitects","alternateName":"SOFTWAREarchitects","url":"https:\/\/www.angulararchitects.io\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg","contentUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg","width":644,"height":216,"caption":"ANGULARarchitects"},"image":{"@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/github.com\/angular-architects","https:\/\/www.linkedin.com\/company\/angular-architects\/"]},{"@type":"Person","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/15628efa7af4475ffaaeeb26c5112951","name":"Manfred Steyer, GDE","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a0b59539674d8b71ea1c1f4764b11244b5f499203f1d11b40f37d8f3f90be033?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a0b59539674d8b71ea1c1f4764b11244b5f499203f1d11b40f37d8f3f90be033?s=96&d=mm&r=g","caption":"Manfred Steyer, GDE"},"sameAs":["https:\/\/x.com\/daniel"]}]}},"_links":{"self":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/posts\/2357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/comments?post=2357"}],"version-history":[{"count":0,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/posts\/2357\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/media\/3010"}],"wp:attachment":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/media?parent=2357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/categories?post=2357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/tags?post=2357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}