从一个html页面我发送下一个html所需的行数和列数。 控制器代码是:
.controller('decisionController', ['$scope', '$rootScope','$state', function($scope,$rootScope, $state){
$rootScope.decvalues;
$scope.saveDecision = function(isValid){
var values=[];
var nameAndDec={
name:$scope.model.name,
description:$scope.model.description,
input_col:$scope.no_of_input,//number of columns
output_col:$scope.no_of_output,//number of columns
rows:$scope.no_of_row,//number of rows
};
values.push(nameAndDec);
$rootScope.decvalues=values[0];
$state.go('rulesEditor.decisionTble');
},
在我的第二个html页面上,我想根据从第一页传递的行数和列数创建一个动态表。 我想在第二个html页面上显示这种具有给定行数和列数的结构
这是我的第二个html页面:
<table border="1" cellpadding="10">
<thead>
<tr>
<!--For getting a checkbox in eack row -->
<th ng-repeat="values in decvalues.rows">
</th>
<!--Add number of input columns header as per input got from first page -->
<th ng-repeat="values in decvalues.input_col">
(I) <enter data> <input type="checkbox"></input>
</th>
<!--Add number of output columns header as per input got from first page -->
<th ng-repeat="values in decvalues.output_col" >
(O) <enter data> <input type="checkbox"></input>
</th>
</tr>
</thead>
<tbody>
<!--Add number of rows as per input got from first page -->
<tr ng-repeat="row in decvalues.rows">
<td ng-repeat="col in decvalues.input_cols">
(I) <enter data>
</td>
<td ng-repeat="col in decvalues.output_cols">
(O) <enter data>
</td>
</tbody>
</table>
我在控制器上获取此值,但在我的第二页表上没有生成