The Good and Bad Parts of AngularJs JavaScript Framework

Back to Blog
Ezeelive Technologies - AngularJS JavaScript Framework Company India

The Good and Bad Parts of AngularJs JavaScript Framework

AngularJS is a structural framework of the JavaScript to make the web apps and applications. AngularJS (version 1.x) is what HTML would have been had it been designed for applications to use its features. HTML is a great declarative language for static documents. which helps you to modify your web applications in an easy way. Now we will try to see some good and bad parts of the AngularJS below:

Good Parts of AngularJS (version 1.x) JavaScript Framework:

1. MVC Compatibility (or MVVM or MVP or MVW):

There is a debate on Google+ by Igor Minar (Lead of AngularJS) post in the AngularJS forum, deciding to call Angular an MVW framework: Model – View – Whatever!

I’d rather see developers build kick-ass apps that are well-designed and follow separation of concerns than see them waste time arguing about MV* nonsense. And for this reason, I hereby declare AngularJS to be MVW framework – Model-View-Whatever. Where Whatever stands for “whatever works for you”.
— Igor Minar

In another world, AngularJS is MVC Compatibility and does not require writing lengthy code to connect the MVC components of the apps, which saves them lots of time and effort. Just make the modules of your applications and rest of your work will do the Angular by managing the components and also connecting them all by itself.

2. Two Way Data binding:

AngularJS comes with the great feature called as data binding which reduces the coding at very less number of lines.

Data binding tries to get rid of writing the codes multiple times by doing the work on backend server from creating the multiple executions of the same codes. Data binding removes the dependency on manually accessing the values.

<div ng-app>
First Name:
<input type="text" ng-model="firstName"/>
Last Name:
<input type="text" ng-model="lastName"/>
<div>Hello {{ firstName + " " + lastName }}!</div>
</div>

<div ng-app="" ng-init="student={firstName:'Rajeev',lastName:'Sharma'}">
<div>The name is <span ng-bind="student.lastName"></span></div>
</div>

3. Dependency injection:

It’s nothing new in the back end development world but in the JavaScript world, it’s painful been slow to become a part of our coding workflows.

AngularJS handles a Duplicate injection at the great level. We will try to illustrate the same with the dependent objects 500 times because we think JavaScript is not same as structured complex backend application.

angular.module('ccn-main.controllers',[]).controller('LoginController', ['$scope', 'loginService', function($scope , loginService) {
// Login functionality
}])

This allows you to serve the libraries to be used in the development phase.

4. DOM Manipulation:

AngularJS keeps DOM manipulation inside the directives and not in the views part also code not comes in the controller part Like:

app.directive('focusInput', function($timeout) {
   return {
      link: function(scope, element, attrs) {
        element.bind('click', function() {
           $timeout(function() {
              element.parent().parent().find('input')[0].focus();
           });
        });
      }
    };
});

5. Testability:

AngularJS Framework builds with Unit testing ready because it uses dependency injection. Angular provides separately application logic from the DOM manipulations, making testing a lot easier.

It is a really, really good idea to regard app testing as equal in importance to app writing. The testing difficulty is dramatically affected by the way the code is structured.

— The Zen of Angular

6. Dynamic Templates and Supports Single Page Applications:

According to AngularJS official document there is 4 types element and attributes support by AngularJS is Directive, Markup, Filter, Form controls.

Which makes it the very strong framework to support HTML template system that helps to work design and developer separately on the same system. In simple app, the consist of HTML and CSS and complex app you can use the ngView directive to load partials based on configuration passed to the $route service

Bad Parts of AngularJS (version 1.x) JavaScript Framework:

1. Parameter name based dependency injection:

Angular has a built-in dependency injector that will pass appropriate objects to your function based on the names of its parameters.

function myController($scope, $window) {
// ...
}

2. Difficult to adapt the existing code:

With AngularJS you can’t reuse the existing code it gives the error immediately if you will try to use the code again in the program. So, it requires some developers who can work on it to extend its features in so that we can use the code again which existing in the programme.

3.Too Heavy framework:

AngularJS is very heavy and bulky framework that might be a good option to make the large-scale application.But in case of simpler requirements of data binding, it will require a little too much effort to extract its features and using those features because it can sometimes confuse them with the excess of functionality that might be totally useless.

4.Robust Framework:

AngularJS is a very Robust and viable framework for building the web apps. Whether it lives up to the expectations of being the most dominant JavaScript framework for web development is yet to be decided and seen.

Conclusion:

As we saw the many pros and cons of the AngularJS in the development so it lastly depends on you that which feature you have to select of AngularJS in the development.

Because to make the robust applications then it will be difficult to use the AngularJS but to make the application MVC compatible and dependency management then you could use the AngularJS.

Share this post

Comments (3)

  • Fredrik Bonander Reply

    Good article, one small note on The Bad Parts 1.

    While this is true:

    function myController($scope, $window) {
    // …
    };

    A better (and safer way) todo this is:

    angular.controller(‘myController’, [‘$scope’, ‘$window’, function ($scope, $window) {
    // …
    }]);

    This allows you code to be minified and your arguments are no longer bound have a correct name.

    November 27, 2014 at 1:01 pm
    • Rajeev Sharma Reply

      @Fredrik – Thanks for your comment.. i really appreciate your update.

      November 30, 2014 at 12:07 pm
  • Vikram Krishna Reply

    Thanks for the wonderful post Rajeev! There is always a positive and negative side in every domain or technology or whatever it may be. It is up to our own requirements. AngularJS also has both positive and negative sides as you mentioned above. But still it has its own place in development.

    Thanks again!

    June 7, 2018 at 4:22 pm

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to Blog