showing two dimentional JSON in angularJS

Belo is the code definig about showing two dimentional JSON in angularJS. Its a beginners action of displaying records. You can learn fancy methods of manupulating logics in angularJS.

/* showing two dimention JSON in angularJS */

<!DOCTYPE html>
<script src=””></script>

<div ng-app=”helloApp” ng-init=”{{companies}}”>
<div ng-controller=”CompanyCtrl” >
<p>Looping with ng-repeat:</p>
<li ng-repeat=”x in companies”>
{{ }} {{ x.employees }} {{ x.headoffice }}

var helloApp = angular.module(“helloApp”, []);

helloApp.controller(“CompanyCtrl”, function($scope) {
$scope.companies = [
{ ‘name’:’Infosys Technologies’,
’employees’: 125000,
‘headoffice’: ‘Bangalore’},
{ ‘name’:’Cognizant Technologies’,
’employees’: 100000,
‘headoffice’: ‘Bangalore’},
{ ‘name’:’Wipro’,
’employees’: 115000,
‘headoffice’: ‘Bangalore’},
{ ‘name’:’Tata Consultancy Services (TCS)’,
’employees’: 150000,
‘headoffice’: ‘Bangalore’},
{ ‘name’:’HCL Technologies’,
’employees’: 90000,
‘headoffice’: ‘Noida’},

Leave a Comment