将JSON数据转换为Angularjs中的表(类似于Matrix),添加了额外的列和动态标头

时间:2017-04-24 06:39:53

标签: javascript angularjs asp.net-mvc

我有下面的Json对象,我想完全按照下面描述的方式转换为表格,使用总重量百分比列,标题应该使用ng-repeat动态打印。

$scope.Data = [{
    Year: 2014,
    Month: Jan,
    Location: "LocationA",
    Value: 201
  },
  {
    Year: 2015,
    Month: Feb,
    Location: "LocationB",
    Value: 560
  },
  {
    Year: 2014,
    Month: Jan,
    Location: "LocationC",
    Value: 320
  },
  {
    Year: 2015,
    Month: Feb,
    Location: "LocationD",
    Value: 240
  }

]

enter image description here

0 个答案:

没有答案