Angular is a framework created by Google. Angular application gives user experience similar to a desktop or mobile app where we feel the application resides on a single page. Inside and angular web application a site is divided into pieces called components. Angular is a component based front end framework. Angular allows you to create reusable components for developing large scale applications.
An Angular Component is made up of 3 parts:
1. Template – Containing HTML which is rendered unto page.
2. Class – Contains properties and methods pulled into the template then rendered into page
3. Metadata – Tells angular which class and template make up the component
Inside meta data there is a selector which is a custom HTML tag also known as a directive used to tell an angular app where to use which component unto the page. This is how angular makes HTML more expressive and powers up HTML with if conditions, for loops, and data bindings.
What is Data Binding?
Pros and cons of AngularJS
Pros of AngularJS
Two-way data binding. AngularJS was built with Model-View-Controller architecture. And the framework synchronized the Model and the View. As the data in the Model changes, the View does too. Two-way data binding allowed engineers to reduce development time as it didn’t require writing additional code to provide continual View and Model synchronization.
Directives. This feature actually enabled the HTML extension mentioned above. Directives allowed developers to assign special behaviors to the Document Object Model (DOM), permitting engineers to create dynamic and rich content with HTML.
Dependency injection. Dependencies define how different pieces of code interact with each other and how the changes in one component impact the other ones. Usually, dependencies are directly defined in the components themselves. So that every change in dependency requires changing components as well. With AngularJS, you could use injectors that defined dependencies as external elements decoupling components from their dependencies. Dependency injection made components more reusable, easier to manage and test.
Community. Right from the beginning, AngularJS became extremely popular among engineers. A strong community provided enough training materials, discussions, and third-party tools to embark on using AngularJS as well as find a solution to nearly every arising issue.
Cons of AngularJS
Performance. Dynamic applications didn’t always perform that well. Complex SPAs could be laggy and inconvenient to use due to their size.
Steep learning curve. As AngularJS is a versatile instrument, there is always more than one way to complete any task. This has produced some confusion among engineers. However, the abundance of tutorials and issue discussions allowed for resolving most of the problems.