Regarding differences in execution of Angular vs. JQuery
Angular.js is a framework .
When executing Angular.js, the load occurs, where its DOM and JavaScript tree is transformed into an angular application.
This is because HTML code with special characters (directives and angular filters) is compiled and angular performs a link between Controller, Model and View (default MVC).
Therefore, you need to understand these drivers, services, policies, etc. I understand that it is a moderate learning curve.
It would be a good choice for an application that has CRUD for example.
Just include the ng-app property in the html element where you want to "enable" angularJS:
<html ng-app>
<head>
<title>Lista de compras</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js"></script></head><body>Hello<inputtype="text" ng-model="yourName"/>
<h1>Hello {{yourName}}</h1>
</body>
</html>
In addition to the ng-app property (line 1), we use the ng-model property for DataBind to indicate that this element will be bound to an AngularJS variable, through variable yourName, in line 8. This means that any change in the text box will update the value of the variable.
Every time a template is updated - whether through an asynchronous AJAX call, or through direct manipulation
somewhere in the Controller code, Angular updates the data model and keeps it in sync with the View.
Among Objectives / Features:
- Abstraction DOM manipulation of application logic. This improves code testing.
- Abstracts the coupling between the client side and the server side of the application. This allows application development to evolve on both sides, in parallel, and allows reuse of code.
- Guide developers through building the entire application: from interface design, through business rule writing, to application testing.
JQuery is a library javascript for DOM manipulation (eg changing an element's colors, onclick events, animation, etc ...).
When executing JQuery, your code will make calls to functions of a library, requested by some DOM event for example.
Now to load JQuery insert the reference to the library: <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.js">
ThenweinsertajQueryfunctiononthepagesothatwhenthepageisreadywecanuseJQuery:
$(function(){//QuandoapáginaestivercarregadaRealizarAlgo();})
AmongObjectives/Features:
- Resolutionofincompatibilitybetweenbrowsers.
- Reducingcodebyreusingcodethroughpluginscreatedbyotherdevelopers.
- WorkswithAJAX.
- SecureimplementationofCSSfeatures.
Regardinguse,Ifoundthislink link