Whether you are diehard fan of knockoutJS or evangelist of Ember / backbone or any other framework that you are using now, you wouldn’t want to miss out on AngularJS. I will list out the 5 reasons that will explain why AngularJS is gaining so much momentum recently and why you should take it seriously.
1: MVC Components:
Many of MVC frameworks would split the MVC components thus
giving you lots of work to string them together. AngularJS simply asks you to
split your app into MVC components, then takes care of the rest.
2. Two way Data- Binding
Probably the coolest and most useful feature of AngularJS. Most
of the web application code is dedicated to traversing, manipulating, and
listening to the DOM. AngularJS saves you from all the trouble and handles synchronization
between the DOM and model and vice versa. You can bind your data value using a
code similar to the one below
<!doctype html>
<html
yourapp>
<head>
<script src="http://code.angularjs.org/angular-1.0.0rc10.min.js">
</script>
</head>
<body>
<div>
<label>Field
Name:</label>
<input type="text" your-model="Firstname" placeholder="Enter
your first name here">
<hr>
<h1>Hello,
{{FirstName}}</h1>
</div>
</body>
</html>
3. Declarative user
Interface
HTML is a declarative language which is more intuitive and
guess what? AnuglarJS uses HTML to define the interface of your app. Since HTML
is also used to determine the execution of the app, it simplifies the apps
development in significant way.
4. Dependency
AngularJS built-in dependency injection system makes it
easier to develop and test the applications. Dependency Injection (DI) lets
developers ask for dependency instead of searching through them. Simply define
what you want and AngularJS will take care of dependencies.
5. Directives
This feature tops my list of favorite things about
AngularJS. Wonder what it will be like
if your HTML has so many rich elements that will do the tricks for you (like <accordion></accordion>
or <lightbox></lightbox> ) and you don’t have to manipulate DOM to
stimulate them. You may also invent your own HTML tags that serves as new,
custom widgets.
myModule.directive('myComponent',
function(mySharedService) {
return {
restrict:
'E',
controller:
function($scope, $attrs, mySharedService) {
$scope.$on('handleBroadcast',
function() {
$scope.message
= 'Directive: ' + mySharedService.message;
});
},
replace:
true,
template:
'<input>'
};
});
Your custom widget:
<my-component
ng-model="message"></my-component>
Take away:
We covered only 5 essential features out of many advantages
of using AnglurJS and why we strongly recommend using it. The take away here is
that AnglurJS is a great JavaScript framework that has fantastic and easy
features for both designers and developers. So what’s stopping you from using AnglurJS?
What are the challenges you faced while using it? Whether you love it or hate
it, Share your views in the comments section.
Best
No comments :
Post a Comment