【发布时间】:2017-12-25 17:42:39
【问题描述】:
我在前端使用 angular.js, I am having some list of values in DB.
控制器代码:
我在控制台中得到以下输出。 控制台.log($scope.items);
$scope.items = [
{
salary_head_name : 'BASIC',
salary_head_value : 15000,
salary_head_type : 'E'
}, {
salary_head_name : 'HRA',
salary_head_value : 7500,
salary_head_type : 'E'
},{
salary_head_name : 'Conveyance',
salary_head_value : 1600,
salary_head_type : 'E'
},{
salary_head_name : 'Med. Allow',
salary_head_value : 1800,
salary_head_type : 'E'
},{
salary_head_name : 'PF',
salary_head_value : 1800,
salary_head_type : 'D'
}
];
实际上,它会打印所有记录。
UI 中的预期输出:enter image description here
【问题讨论】:
-
请展示你到目前为止所做的尝试。
-
嗨,我得到了一个数组对象,它在单个数组对象中同时具有收入和扣除头,但我想显示收入头和前两列的金额,扣除额和第三列的金额和第 4 栏...请您帮我解决这个问题...?
-
您是否尝试过任何您想要的显示表格代码?
-
是的,我使用简单的 ng-repeat 在表中显示列表..
标签: html angularjs angularjs-directive angularjs-ng-repeat