Create Table from JSON Data with angularjs and ng-repeat

后端 未结 6 1391
-上瘾入骨i
-上瘾入骨i 2020-12-09 05:32

I have the following data as JSON:

{
  \"Workout1\": {
    \"Name\": \"First\",
    \"Rounds\": [
      {
        \"Exercises\": [
          {
            \"         


        
6条回答
  •  青春惊慌失措
    2020-12-09 05:44

    You can use $http.get() method to fetch your JSON file. Then assign response data to a $scope object. In HTML to create table use ng-repeat for $scope object. ng-repeat will loop the rows in-side this loop you can bind data to columns dynamically.

    I have checked your code and you have created static table

    Name Relationship
    {{ indivisual.Name }} {{ indivisual.Relation }}

    so better your can go to my code to create dynamic table as per data you column and row will be increase or decrease..

提交回复
热议问题