Did you ever think why new technology comes to the market after every period of time? Here is the answer,
We Programmers want to serve the world a magic. This magic makes us more curious as the day passes.
Lets be with this magic (Angular) again.
What is Angular:-
It is a MV* . (* stands for whatever). Some programmers call it only MVC which is not true. You can associate anything with MV* pattern.
* can be a controller or Presenter or ViewModel or etc.
Every Business/Programmer has a vision to deliver the things fast with great efficiency and performance. This is what Angular meant to be.
Google’s highly skilled team analysed this requirement of the market and put their effort to make the web development easy.
Angular made programmers fall in love with it not because it is easy to implement, It has most of the features a web developer needs.
We will talk about the features of Angular in this article later.
Lets talk about some aspects of Angular.
1) First of all, Angular is an open source because it is an open source, there are number of contributors to this community.
2) It handles your AJAX calls to the server using some built in services.
3) You can load partial templates to the particular div (This is a part of DOM manipulation).
4) It follows basic keys that we need to make SPA(Single page application) such as routing, templates, bindings etc.
5) The best and unique part of Angular is directive. You can extend HTML anytime in the running application using directive.
6) Easy to test. Angular team kept in mind the term Testability while developing this framework.
Lets move to architectural benefit of Angular.
1) Two way binding: Angular binds the data of HTML elements with the model associated with it. It does not wait for an event to be fired
and respond accordingly. Everything has been written in the directives of the Angular.
2) Dirty checking: It keeps checking the HTML elements and update model accordingly.
3) Dependency Injection: Again, this feature is just awesome. It improves testability of your application.
Dependency Injection is a software design pattern that is used for resolving the dependencies. As Wikipedia says,
“An injection is the passing of a dependency to a dependent object (a client) that would use it.”
There are three common means for a client to accept a dependency injection: setter-, interface- and constructor-based injection.
Basic Features of Angular:-
1) Data binding
7) Dependency Injection
1) Data Binding:
Data binding in AngularJS is the synchronization between the model and the view.
AngularJS lets you extend HTML with new attributes called Directives, e.g. ng-app,ng-Init, ng-controller,ng-model etc.
There are approximately 70 built in directive in AngularJS. You can make custom directives as per your need.
Templates are written with HTML that contains Angular-specific elements and attributes.
Angular combines the template with information from the model and controller to render the dynamic view
that a user sees in the browser.
Angular services are substitutable objects that are wired together using dependency injection (DI).
You can use services to organize and share code across your app.
Filters can be added in AngularJS to format data, e.g. currency, date,lowerCase, uppercase etc.
7) Dependency Injection:
Dependency Injection is a software design pattern in which an object is given its dependencies, rather than the object creating them itself, e.g. we inject services, factories object inside controller to call the functions written in factories or services.
AngularJS helps to do client-side validation.
Routing is the best feature provided by AngularJS. Include ngRoute to make your application SPA(Single page application) with no page reloading.
Angular doesn’t depend on jQuery. In fact, the Angular source contains an embedded lightweight alternative: jqLite.
A factory is a function which allows you to add some logic before you actually create an object.
a) ability to use other services (have dependencies)
b) service initialization
c) delayed/lazy initialization.
Lets get some hands with me on Angular in the next blog.