AngularJS Parsing JSON data RESTful JSON Parsing

AngularJS Parsing JSON data RESTful JSON Parsing

In this Post We Will Explain About is AngularJS Parsing JSON data RESTful JSON Parsing With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Simple RESTful Json parsing using AngularJs TutorialsExample

In this post we will show you Best way to implement ajax – RESTful JSON Parsing with angularJS, hear for AngularJS Tutorial RESTful JSON Parsingwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

How to use?

Also Read :  jQuery DataTables Responsive Example

phase 1

Include the simple ng-app directive as well as id=’ng-app’ to the html tag, so Angular js knows to execute step by step on the web page.

<!doctype html>
<html lang="en" ng-app id="ng-app">

ng-app

initalization HTML an element as a root simple element of the web-application allowing data to be modified some through custom DOM HTML tags.

phase 2

We have to include some Angular

We can display post JSON data values from using their data attributes in like as expressions like {{stud.post_title}}, {{stud.url}}, some etc.. Here the id="ng-app" is most important data binding for Internet Explorer or other browser data binding.

<div id="ng-app" ng-app ng-controller="liveCtrlAjax"> 
 
<div ng-repeat="stud in students">
<h2>
<a href='{{stud.url}}'>{{stud.post_title}}</a>
</h2>
<div class='date_tme'>{{stud.date_tme}} - {{stud.author}} </div>
<p>{{stud.liveDesc}}</p>
<img ng-src="{{stud.pictures}}" />
</div>
   
</div>

ng-controller

Specifies a simple JavaScript controller angularjs conditions class that evaluates DOM HTML expressions.

ng-repeat

Instantiate an HTML element once per product from a collection.

Data Filter - ng-show

ng-show some directive is helps We get data display specific result.

<div id="ng-app" ng-app ng-controller="liveCtrlAjax" ng-show="stud.author== 'Ravi patel'">

Uppercase

For getting uppercase some results, We can do this with simple CSS too just adding text-transform:uppercase; style.

<h2>
{{stud.post_title | uppercase}}
</h2>

Final Code - index.html

<!doctype html>
<html lang="en" ng-app id="ng-app">
<head>
<title>Live Page Title :  Pakainfo.com</title>
<script src="js/angular.js"></script>
<script>
function liveCtrlAjax($scope, $http)
{
$http({method: 'POST', url: 'js/students.json'}).success(function(data)
{
$scope.students = data; // Pakainfo.com response data 
});
}
</script>
</head>
<body>
<div id="ng-app" ng-app ng-controller="liveCtrlAjax">
 
<div ng-repeat="stud in students" >
<h2>
<a href='{{stud.url}}'>{{stud.post_title}}</a>
</h2>
<div class='date_tme'>{{stud.date_tme}} - {{stud.author}} </div>
<p>{{stud.liveDesc}}</p>
<img ng-src="{{stud.pictures}}" />
</div>
   
</div>
</body>
</html>

Example

I hope you have Got What is angularjs http get example with parameters And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

Leave a Reply

Your email address will not be published. Required fields are marked *