AngularJS Key Concepts – Part 1

0

The article represents certain key concepts of AngularJS javascript framework. I shall be writing further articles presenting my learning as I go ahead.

  • AngularJS is a great (so-called Super-heroic) framework if you want to build single page applications (SPA) consisting of multiple views (smaller web pages so to say). That said, it is not limited to SPAs and could be used with any kind of web applications. If you have worked in past with JQuery, you would be amazed to see the simplicity that AngularJS brings on the table with respect to DOM manipulation. Just this feature has got me on board with Angular.
  • Modular framework: Angular is a modular framework. Angular modules, simply speaking, are containers. They could be used to create some of the following:
    • Controller
    • Directive
    • Filter
    • Config
    • Factory/Provider/Services¬†
  • Key Characteristics: Following are the areas where AngularJS shines or, in other words, key characteristics:
    • MVC (Model-view-controller)
    • Views have directives, filters etc. There could be multiple views on a single page. There could be different views such as mobile, desktop etc.
    • Controllers is used to provide methods to act upon the views. Each view need to be associated with a controller. It is the route that configures a view with a controller. Controller and View are glued together using $scope object.
    • Controllers use services/factories/providers etc to provide CRUDs etc.
    • DOM manipulation (jqLite)
    • Data binding
    • Routing: The concept is key to SPA. It is used to load different views and controllers based on different routes.¬†
    • Directives: There are out-of-the-box directives available from Angular. That said, one could also create custom directives as and when required. Some of the most commonly used directives are ng-app, ng-model, ng-click, ng-submit, ng-repeat, ng-controller etc.
    • Ajax/Promises (Async)
    • Object/module/view loading
    • Dependency injection
    • Testing
  • Key Terminologies
    • $scope: It is very important to understand the concept behind $scope when understanding Angular views and controllers. $scope acts as a glue between view and controller. Angular automatically inserts/injects (using inbuilt dependency injection) a scope object into a controller as the controller gets used. As the ng-controller is applied to an element such as body or div, the scope becomes available to the view.
  • Important AngularJS bookmarks for Developers

 

[adsenseyu1]

Ajitesh Kumar

Ajitesh Kumar

Ajitesh has been recently working in the area of AI and machine learning. Currently, his research area includes Safe & Quality AI. In addition, he is also passionate about various different technologies including programming languages such as Java/JEE, Javascript and technologies such as Blockchain, mobile computing, cloud-native technologies, application security, cloud computing platforms, big data etc.

He has also authored the book, Building Web Apps with Spring 5 and Angular.
Ajitesh Kumar

Leave A Reply

Time limit is exhausted. Please reload the CAPTCHA.