What is angualarjs ?
AngularJS is one of the most popular JavaScript UI framework which works on client side MVVM model. Here client side means using JavaScript we will create the MVVM. The main advantage here for the AngularJS is Two-way data binding. The two-way data binding is quite easy and simple by using AngularJS.
Main Component of Angularjs
What is Services ?
Services are singletons, which are objects that are instantiated only once per app (by the $injector). They provide an interface to keep together methods that relate to a specific function.
What is filters ?
Filters are added to angularjs expression or directives in order to transform the displayed data , they are use by pipe symbol (" | " ). example of filter :- currency Format a number to a currency format. date Format a date to a specified format. filter Select a subset of items from an array. json Format an object to a JSON string. limitTo Limits an array/string, into a specified number of elements/characters. lowercase Format a string to lower case. number Format a number to a string. orderBy Orders an array by an expression. uppercase Format a string to upper case.
Implementation of filter
<div ng-app="myApp" ng-controller="personCtrl">
<p>The name is {{ lastName | uppercase }}</p>
</div>
What is Directives ?
AngularJS directives are extended HTML attributes with the prefix ng-.
The ng-app directive initializes an AngularJS application.The ng-init directive initializes application data.The ng-model directive binds the value of HTML controls (input, select, textarea) to application data
default directives :-ng-repeat,ng-show,etc
How to make our directive ---
app.directive("rd", function() { return { template : "<h1>Made by a directive!</h1>" };});
form.html
these tag will return the templete which we return in directive<rd></rd>
Comments
Post a Comment