Gives solution for any Error occurs in any Programming Language, .Net Core 3.1, 3.0, C#,Asp.Net,Sqlserver,MVC,Java,Php,Html,Css,Jquery,errors and solutions,Latest News,Technology

Monday 19 September 2016

AngularJs Nested Array of Objects With ng-repeat Table in MVC | PHP | Html

1 comment :
<!DOCTYPE html>
<html>
  <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js">
  </script>
  <body>
    <div ng-app="App" ng-controller="studentsCtrl">
      <table border="1">
        <tr ng-repeat="x in stdDetails.students">
          <td>{{ x.Name }}
          </td>
          <td>{{ x.Country }}
          </td>
          <td ng-repeat="m in x.Marks">{{m.Maths}}
          </td>
          <td ng-repeat="m in x.Marks">{{m.Physics}}
          </td>
        </tr>
      </table>
    </div>
    <script>
      var app = angular.module('App', []);
      app.controller('studentsCtrl', function($scope) {
        $scope.stdDetails={
          "students": [
            {
              "Name": "Raja",
              "City": "Hyderabad",
              "Country": "India",
              "Marks":[
                {
                  "Maths":"75",
                  "Physics":"90"
                }
              ]
            }
            ,
            {
              "Name": "Ramu",
              "City": "CF",
              "Country": "USA",
              "Marks":[
                {
                  "Maths":"95",
                  "Physics":"60"
                }
              ]
            }
          ]
        }
      }
                    );
    </script>
  </body>
</html>

1 comment :

  1. Buy your own premium oakley titanium glasses
    A great choice for titanium watches you when you micro touch hair trimmer order a titanium nose jewelry beer with a titanium fishing pliers special 2017 ford focus titanium price tag. These quality crafted glassworks have a quality, quality design that

    ReplyDelete