Skip to content
Related Articles

Related Articles

Difference between JavaScript and AngularJS
  • Last Updated : 28 Oct, 2020

JavaScript: JavaScript is a lightweight and object-oriented scripting language used to create dynamic HTML pages with interactive effects within a webpage. It is an interpreted scripting language and its code is run in a web browser only and in order to execute and run the code outside the browser we can use Node.js. It is also called a browser’s language and can be used for client-side developments as well as server-side developments. It was developed by Brendan Eich at Netscape and was first released in 1995.
 

  • JavaScript was created in the first place for DOM manipulation. Earlier websites were mostly static after JS was created dynamic Web sites were made.
  • Functions in JS are objects. They may have properties and methods just like another object. They can be passed as arguments in other functions.
  • Can handle date and time.
  • Performs Form Validation although the forms are created using HTML.
  • No compiler needed.

JavaScript Example:

javascript




<!DOCTYPE html>
<html>
 
<head>
    <title></title>
</head>
 
<body bgcolor="white">
    <p>Paragraph 1</p>
    <script type="text/javascript">
        document.bgColor = "lightblue";
    </script>
</body>
<html>

Output:

AngularJS: AngularJS is an open-source front-end web development framework for creating web applications and has great functionality and support. It was released in the year 2010 by the angular team of Google. It is a constantly developing and expanding framework which provides improved methods for developing web applications. It mainly works on the model view controller (MVC) concept for building apps and supports both dependency injection and data binding features.
 



  • Easy to work with: All you need to know to work with AngularJS is basics of HTML, CSS and JavaScript, not necessary to be an expert in these technologies.
  • Time saving: AngularJS allows us to work with components and hence we can use them again which saves time and unnecessary code.
  • Ready to use template: AngularJS is mainly plain HTML, and it mainly makes use of the plain HTML template and passes it to the DOM and then the AngularJS compiler. It traverses the templates and then they are ready to use.

AngularJS (version 1.5)  was replaced by Angular (Typescript) in 2016. They are completely different frameworks.  Angular is currently at version 10.

AngularJS Example:

javascript




<!DOCTYPE html>
<html>
 
<head>
    <script src=
    </script>
</head>
 
<body>
    <center>
        <div ng-app="">
            <h1>{{txt}}</h1>
            <p>
                <input type="text" ng-model="txt" />
            </p>
        </div>
    </center>
</body>
 
</html>

Output: 
 

Difference between JavaScript and AngularJS :

S.No.JavaScriptAngularJS
1.It was developed by Netscape.It was developed by Google.
2.It is a lightweight and object-oriented scripting languageIt is an open source framework.
3.It works on concept of dynamic typing.It works on model view controller (MVC) concept for building apps.
4.JavaScript is fast in comparison to AngularJS.It is slow in comparison to JavaScript.
5.It does not supports dependency injection.While it supports both dependency injection and data binding.
6.It is complicated for beginners to learn JavaScript.It is easy to learn AngularJS for beginners who knows JavaScript.
7.It does not provide support for filters.It provides support for filters.
8.It is used for dynamic web applications.It is generally suited for building large single page applications.
My Personal Notes arrow_drop_up
Recommended Articles
Page :