Angular Access Nested JSON object using Ng Repeat

Angular Access Nested JSON object using Ng Repeat

Today, We want to share with you Angular Access Nested JSON object using Ng Repeat.
In this post we will show you AngularJs Nested json ng repeat Example | Nested Ng-Repeat, hear for we will give you demo and example for implement.
In this post, we will learn about How to access nested json object with nested ng-repeat in AngularJs with an example.

AngularJS supported the ng-repeat js directive that allows to Like as a cycle loop over a Data collection and add 1 eneter element for same or each item.If we some needed to every loop over a new collection and want any simple to add more lates than 1 element (example generate 2 or more rows for a new add single item), we can use directive attributes ng-repeat-start and ng-repeat-end directive

Nested Ng-Repeat on AngularJS Example

in this example to ng-repeat inside another ng-repeat with json.

READ :  Angular Call Function on Page Load Example

data-ng-repeat Nested Loop through two dimensional array using angularjs


(adsbygoogle = window.adsbygoogle || []).push({});
Learn AngularJS Directive Like as a: ng-app Directive, ng-init Directive, ng-model, ng-repeat Directive, ng-transclude Directive ,etc.



<title>AngularJs Nested json ng repeat Example</title>


angular.module('app', []);
function liveCtrl($scope){<!--   w  w w  .infinityknow  .com-->
    $scope.rows = [
        {x: [ 9,8,7,6 ]},
        {x: [ 5,6,7 ]},
        {x: [ 9,10,11,12 ]}
    ];
}



	<h1>AngularJs Nested json ng repeat Example</h1>
  <div>
  <hr />
    <div>
        <div class="y">
            <div class="x">{{x}}</div>
        </div>
    </div>
	  <hr />
  </div>



Data.json

[
  {
    "number": "2018-W45",
    "pmasts": [
      {
        "dow": "1",
        "myissueProductpmast": "Monpmast",
        "jobs": [
          {
            "name": "product",
            "jobs": [
              {
                "name": "prepare breakfast",

              }
            ]
          },
          {
            "name": "work 9-5",

          }
        ]
      },
      {
        "dow": "2",
        "myissueProductpmast": "fripmast",
        "jobs": [
          {
            "name": "product",
            "jobs": [
              {
                "name": "Laptop Master",

              }
            ]
          }
        ]
      }
    ]
  }
]

index.html

<div>
   <div>
      {{pmast.dow}} - {{pmast.myissueProductpmast}}
      <b>Products:</b><br /> 
       <ul>
         <li> 
           {{prod.name}} 
         </li>
       </ul>
   </div>
</div>

index.html



    <title>Nested ng-repeat on AngularJS</title>
    
    
var app = angular.module('liveApp', []);
     //liveCtrl Controller define
     app.controller("liveCtrl", function ($scope, bookFactory) {
         $scope.editsomeResult_div = false;
         $scope.get = function (someResult) {
             $scope.my_product_full = someResult;
         }

         $scope.edit = function (subsomeResult) {

             $scope.object = subsomeResult.object;
             $scope.dynemic_add_someResult = subsomeResult.dynemic_add_someResult;
             $scope.name = subsomeResult.name;
             $scope.pricesomeResult = subsomeResult.pricesomeResult;
             $scope.editsomeResult_div = true;
         }
         $scope.Save = function () {
             var subsomeResult = {
                 Date: $scope.object,
                 Time: $scope.dynemic_add_someResult,
                 Day: $scope.name
             };
          
             subsomeResult.ID = $scope.ID;
             $scope.editsomeResult_div = false;
             var saveMSG = bookFactory.update(subsomeResult);
             saveMSG.then(function (messagefromController) {
                 $scope.editsomeResult_div = false;
             });
         }

         $scope.someResult = [{
             date: '2015-02-28',
             time: '15:30',
             day: 'Saturday',
             subsomeResultren: [{
                 object: 'rooms',
                 dynemic_add_someResult: 'complete',
                 name: '1th Person',
                 pricesomeResult: '4500$'
             }]
         },
                  {
                      date: '2015-03-07',
                      time: '08:30',
                      day: 'Saturday',
                     subsomeResultren: [{
                          object: 'yards',
                          dynemic_add_someResult: 'nothing',
                          name: '2th Person',
                          pricesomeResult: '3500$'
                      }]
                  },
                {
                    date: '2015-03-17',
                    time: '16:30',
                    day: 'Tuesday',
                    subsomeResultren: [{
                        object: 'pools',
                        dynemic_add_someResult: 'nothing',
                        name: '3th Person',
                        pricesomeResult: '2500$'
                    }]
                }
         ];
     }
     );

     //Factory
     app.factory("bookFactory", ['$http', function ($http) {

         var urlBase = '/book/orderdetails';
         var bookFactory = {};

         //someResult Save
         bookFactory.update = function (subsomeResult) {
             return $http.put(urlBase + '/' + subsomeResult.ID, subsomeResult)
         }

         return bookFactory;
     }]);




    <ul>
        someResult Filter:
        
        <hr />
		<hr />
        <div>
            <table>
                <tr>

                    <td>
                        
                    </td>


                    <td>
                        
                    </td>


                    <td>
                        
                    </td>


                    <td>
                        
                    </td>

                    <td colspan="2">
                        
                    </td>
                </tr>
            </table>
        </div>
        <br />
        <li>
            {{item.date}} - {{item.time}}<br />
            {{item.day}}
            <br /><br />
            <ul>
                <li>
                    object: {{subsomeResult.object}},
                    Note: {{subsomeResult.dynemic_add_someResult}},<br /> Your Order: {{subsomeResult.name}}, pricesomeResult: {{subsomeResult.pricesomeResult}}
                    

                </li>
                <hr />
				 <hr />
				  <hr />
            </ul>

        </li>
        
        All hbookstemp of Book:
        <li>{{hbookstemp.date}}, {{hbookstemp.time}}, {{hbookstemp.day}}</li>

    </ul>



Example

READ :  Angularjs math expression - number expressions Example

Example 2

We hope you get an idea about Angular Access Nested JSON object using Ng Repeat
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.

Leave a Reply

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