Components in AngularJS


AngularJS has been around for quite some time on the Web. Many legacy AngularJS apps need to be migrated or upgraded to the latest Angular or other UI frameworks like Vue or React. There are many challenges when upgrading or migrating an AngularJS application, as well as many different approaches. In this post, we will see how Web Components allow us to create a compatibility bridge between different Web technologies.

Web Components (Custom Elements) are a Web standard for defining custom HTML tags. Web Components work similarly to other component models allowing data to be passed in via Properties/Attributes and notify of changes to the host application through Custom Events.

Create a component

Generate a component using Angular CLI

Run ng generate component for home page..  

  • ng generate component home OR ng g c home