Difference between JavaScript and AngularJS

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

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


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

filter_none

edit
close

play_arrow

link
brightness_4
code

<!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>

chevron_right


Output: 
 

Difference between JavaScript and AngularJS :

S.No. JavaScript AngularJS
1. It was developed by Netscape. It was developed by Google.
2. It is a lightweight and object-oriented scripting language It 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.

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



Improved By : bunnyram19, tim17