Does Angular 2 replace jQuery and AJAX?

Asked

Viewed 1,124 times

6

With the use of Angular 2, it is still necessary to use jQuery and AJAX or Angular to replace 100% of these 2 technologies?

1 answer

10


Angular replaces 100%. It is possible to mix if you are dependent on old code. But the idea is to leave jQuery behind...

If you never knew jQuery existed it was almost better to start an app in Angular, Vue or React :)

The concept of this new generation of reactive applications is to not touch the DOM as before. The application takes care of the DOM and the programming paradigm should be more functional/reactive. When something in the state (state) of the application changes it should be reflected in the DOM. And not like before: use jQuery to implement in DOM what is in state. Or even worse, go read in DOM data for application processing.

There are obviously things jQuery can still be useful at. Ajax is one of them. But it is preferable in this case to use more specialized libraries for features that are needed. Angular has the $http, React and Vue.js are agnostic, so you can use whatever you want. If necessary, the Axios is a good alternative.

  • 1

    Good answer, I just think I should quote the "Ajax" that the AP speaks.

  • @LINQ well put together. Thank you.

  • In case this React replaces Angular? or they walk together?

  • @Nicolabogar React, Vue and Angular are the 3 most popular libraries in this new generation of "reactive libraries".

  • I understood, so I should just try to learn 1 technology, I wouldn’t need to learn all, right ?

  • @Exact nicolabogar. They’re all Javascript, so knowing Javascript is the most important thing, and you can do it in parallel with one of these clear libraries.

  • Perfect @Sergio, you know where I can find some angular documentation with ASP.NET MVC, I searched the internet and saw that this topic is very scarce, I could only find with ASP.NET CORE

  • @Nicolabogar actually no. The world ASP.NET is completely alien to me :) I’m more at home with Node.js and PHP... But if you have any specific doubts there are good people here who want to help.

  • 1

    @Sergio, thank you so much for the clarifications friend..

  • @Nicolabogar!

  • And the Mootools? :)

  • 1

    @Maniero Mootools is much more powerful than jQuery, so it can do what Angular does or Vue with more quality. But it is of another generation and in practice abandoned, unfortunately.

Show 7 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.