What is AngularJs ?
AngularJs vs jQuery
One of the most commonly question comes in mind that why AngularJs when coming from a jQuery background like me. What is the advantage of AngularJS over jQuery ? .
I am trying to explain it here.
– jQuery, library for the dom, tell it what do, looking on html isn’t enough where as AngularJS, framework to build applications, we extend it after it’s law and principles.
When we write Angular apps, we don’t separate how we write our page and our interaction; instead, we define the functionality inside our HTML. Angular very clearly lays out a strategy of building applications using the data to drive the functionality.
– AngularJS is built in lots of cool features like Routing (handling updates to the URL hash fragment), Templating ( dynamically creating and updating HTML based on templates and models ) , Data binding ( synchronize the model and user interface ) and many more.
Main Features of Angular JS
Main features of Angular JS are given below:
It is the business logic behind views. The Controller is responsible for construction of the model and connects it to the view (HTML). And is responsible for setting initial state and augmenting $scope with methods to control behavior. The scope be seated between the controller and the view. Controllers should be frank and simply contain the business logic wanted for a view.
The View is grounded on DOM objects, not on strings. The view is the HTML. HTML is declarative – well suited for UI design. The View might not contain any functional behavior. The flexibility here is to allow for multiple views per Controller. This division creates a solid base to architect your application. The $scope has a reference to the data, the controller defines behavior, and the view handles the layout and handing off collaboration to the controller to respond accordingly.
The Services in AngularJS are singletons that accomplish common tasks for web applications. If you want to share common functionality between Controllers, then use Services. Built-in AngularJS, Services start with a $. There are several ways to build a service: Service API, $provide API, or the Factory API.
5) Data Binding
Two-way binding in AngularJS
Directives are my personal favorite feature of AngularJS .It permits you to use Directives to transform the DOM or to make new behavior. A directive allows you to extend the HTML vocabulary in a declarative fashion. The ‘ng’ prefix stands for built-in AngularJS directives. The Model (ng-model), the Controller (ng-controller), App (ng-app), etc. are built into the framework. AngularJS allows for building your own directives. Building directives is not difficult, but not easy either. There are different things that can be done with them. It is also probably the most challenging aspect of AngularJS
AngularJS has several built in validation around HTML5 input variables (text, number, radio, checkbox, URL, email) and some directives (required, pattern, min, max, minlength, maxlength). If you need to generate your own validation, it is just as simple as creating a directive to make your validation.
8) Reusable Components
Angular JS uses directives to create reusable code so hide CSS, DOM and its behavior, so you can focus on your look and feel of your application.
This feature allows to Angular JS to multiple locales with the help of stemming and directive.
You can embed Angular JS in your application little or more as per your requirements. It does not require complete framework to work with Angular JS. Angular JS is capable to run multiple apps without iframe, you can view source control and can also look around it.
This does not require any Main() method or start up, you can start from anywhere as per your esteemed requirements. If you don’t need feature or need to reduce can perform seamlessly with Angular JS.
It is designed from starting to test up across the network. It supports fully behavior-view separation and pre bundled with mocks , moreover it comes under end-to-end scenarios which helps to understand its core part.