Javascript 通过Angular JS发布多个阵列数据

Javascript 通过Angular JS发布多个阵列数据,javascript,java,angularjs,Javascript,Java,Angularjs,这是的HTML页面中的视图部分,用户可以通过它填充数据并将其发送到api 在表单中,有三个参数将在单个数组中传递,即day。时不时地。如何在单个数组中传递这三个参数。。。在angular JS中的jSON中,我的代码不起作用我现在还想知道如何在HTML/角度视图端以这种格式发送数据? 我的(我认为它会起作用)Angular Js代码 $scope.schedule = []; $scope.schedule[0] = $scope.data1.day;

这是的HTML页面中的视图部分,用户可以通过它填充数据并将其发送到api

在表单中,有三个参数将在单个数组中传递,即day。时不时地。如何在单个数组中传递这三个参数。。。在angular JS中的jSON中,我的代码不起作用我现在还想知道如何在HTML/角度视图端以这种格式发送数据?

我的(我认为它会起作用)Angular Js代码

  $scope.schedule = [];
                $scope.schedule[0] = $scope.data1.day;
                $scope.schedule[1] = $scope.data1.from_time;
                $scope.schedule[2] = $scope.data1.to_time;

            var dataParam =  {

                                "Schedule":[$scope.data1.schedule]

                              }
         console.log(angular.toJson(dataParam));
HTML代码

<tr>
                                            <th  scope="col"><input type="checkbox" name="checkbox1" ng-model="data.checkbox1"></th>
                                            <td ng-model="data1.day">Sunday</td>
                                            <td>
                                                <div class="col-md-12 col-sm-6 col-xs-12 form-group has-feedback">
                                                <select  id="user_time_zone" ng-disabled="!data.checkbox1" class="form-control form-group" value="Schedule" name="user_time_zone">
                                                    <option id="optionspec" value="" >00</option>
                                                    <option id="optionspec" value="01" >01</option>
                                                    <option id="optionspec" value="02" >02</option>
                                                    <option id="optionspec" value="o3" >03</option>
                                                    <option id="optionspec" value="04" >04</option>
                                                    <option id="optionspec" value="05" >05</option>
                                                    <option id="optionspec" value="06" >06</option>
                                                    <option id="optionspec" value="07" >07</option>
                                                    <option id="optionspec" value="08" >08</option>
                                                    <option id="optionspec" value="09" >09</option>
                                                    <option id="optionspec" value="10" >10</option>
                                                    <option id="optionspec" value="11" >11</option>
                                                    <option id="optionspec" value="12" >12</option>
                                                    <option id="optionspec" value="13" >13</option>
                                                    <option id="optionspec" value="14" >14</option>
                                                    <option id="optionspec" value="15" >15</option>
                                                    <option id="optionspec" value="16" >16</option>
                                                    <option id="optionspec" value="17" >17</option>
                                                    <option id="optionspec" value="18" >18</option>
                                                    <option id="optionspec" value="19" >19</option>
                                                    <option id="optionspec" value="20" >20</option>
                                                    <option id="optionspec" value="21" >21</option>
                                                    <option id="optionspec" value="22" >22</option>
                                                    <option id="optionspec" value="23" >23</option>
                                                </select>

                                                </div>
                                            </td>
                                            <td>
                                                <div class="col-md-12 col-sm-6 col-xs-12 form-group has-feedback">
                                                     <select  id="user_time_zone" ng-disabled="!data.checkbox1" class="form-control  form-group" value="Schedule" name="user_time_zone">
                                                    <option id="optionspec" value="" >00</option>
                                                    <option id="optionspec" value="05" >05</option>
                                                    <option id="optionspec" value="10" >10</option>
                                                    <option id="optionspec" value="15" >15</option>
                                                    <option id="optionspec" value="20" >20</option>
                                                    <option id="optionspec" value="25" >25</option>
                                                    <option id="optionspec" value="30" >30</option>
                                                    <option id="optionspec" value="35" >35</option>
                                                    <option id="optionspec" value="40" >40</option>
                                                    <option id="optionspec" value="45" >45</option>
                                                    <option id="optionspec" value="50" >50</option>
                                                    <option id="optionspec" value="55" >55</option>
                                                    </select>

                                                </div>  
                                            </td>
                                            <td><b>:</b></td>
                                            <td>
                                                <div class="col-md-12 col-sm-6 col-xs-12 form-group has-feedback">
                                                <select  id="user_time_zone" ng-disabled="!data.checkbox1" class="form-control  form-group" value="Schedule" name="user_time_zone">
                                                    <option id="optionspec" value="" >00</option>
                                                    <option id="optionspec" value="01" >01</option>
                                                    <option id="optionspec" value="02" >02</option>
                                                    <option id="optionspec" value="o3" >03</option>
                                                    <option id="optionspec" value="04" >04</option>
                                                    <option id="optionspec" value="05" >05</option>
                                                    <option id="optionspec" value="06" >06</option>
                                                    <option id="optionspec" value="07" >07</option>
                                                    <option id="optionspec" value="08" >08</option>
                                                    <option id="optionspec" value="09" >09</option>
                                                    <option id="optionspec" value="10" >10</option>
                                                    <option id="optionspec" value="11" >11</option>
                                                    <option id="optionspec" value="12" >12</option>
                                                    <option id="optionspec" value="13" >13</option>
                                                    <option id="optionspec" value="14" >14</option>
                                                    <option id="optionspec" value="15" >15</option>
                                                    <option id="optionspec" value="16" >16</option>
                                                    <option id="optionspec" value="17" >17</option>
                                                    <option id="optionspec" value="18" >18</option>
                                                    <option id="optionspec" value="19" >19</option>
                                                    <option id="optionspec" value="20" >20</option>
                                                    <option id="optionspec" value="21" >21</option>
                                                    <option id="optionspec" value="22" >22</option>
                                                    <option id="optionspec" value="23" >23</option>
                                                </select>

                                                </div>
                                            </td>
                                            <td>
                                                <div  class="col-md-12 col-sm-6 col-xs-12 form-group has-feedback">
                                                     <select  id="user_time_zone" ng-disabled="!data.checkbox1" class="form-control  form-group" value="Schedule" name="user_time_zone">
                                                    <option id="optionspec" value="" >00</option>
                                                    <option id="optionspec" value="05" >05</option>
                                                    <option id="optionspec" value="10" >10</option>
                                                    <option id="optionspec" value="15" >15</option>
                                                    <option id="optionspec" value="20" >20</option>
                                                    <option id="optionspec" value="25" >25</option>
                                                    <option id="optionspec" value="30" >30</option>
                                                    <option id="optionspec" value="35" >35</option>
                                                    <option id="optionspec" value="40" >40</option>
                                                    <option id="optionspec" value="45" >45</option>
                                                    <option id="optionspec" value="50" >50</option>
                                                    <option id="optionspec" value="55" >55</option>
                                                    </select>

                                                </div>
                                            </td>



                                            <td>
                                            <div class="col-md-12 col-sm-6 col-xs-12 form-group has-feedback">
                                            <input type="button" class="btn btn-primary"  value="Add Break" id="btn" ng-disabled="!data.checkbox1">
                                            </td>
                                           </tr>

星期日
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
00
05
10
15
20
25
30
35
40
45
50
55
:
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
00
05
10
15
20
25
30
35
40
45
50
55
public class Schedule {
private String Working_day;
private List<String> Working_from;
private List<String> working_to; 

........ }
var dataParam =  {"Schedule":[$scope.data1.schedule]} with
var dataParam =  {"Schedule":$scope.schedule}