Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用php动态创建的“获取选定对象的角度值”复选框_Php_Angularjs - Fatal编程技术网

使用php动态创建的“获取选定对象的角度值”复选框

使用php动态创建的“获取选定对象的角度值”复选框,php,angularjs,Php,Angularjs,我想获得动态创建的复选框值,我已经搜索过了,但没有得到任何解决方案 <div ng-app="formListApp" ng-controller="formListController"> <form action="post" class="ng-pristine ng-valid"> <button class="md-raised" type="button" ng-transclude="" ng-click="applyTemplate()"&g

我想获得动态创建的复选框值,我已经搜索过了,但没有得到任何解决方案

<div ng-app="formListApp" ng-controller="formListController">
<form action="post" class="ng-pristine ng-valid">
    <button class="md-raised" type="button" ng-transclude="" ng-click="applyTemplate()">Allpy Template</button>
    <table>
        <tr id="header" class="header_row_hed">
            <td id="sl_no" class="sl_no_col_hed">Sl.No</td>
            <td id="chk_box" class="chk_box_col_hed">
                <input name="select_all" id="selectAll" class="" style="" ng-model="all" type="checkbox">
                Select All
            </td>
            <td id="form_name" class="form_name_col_hed">Form Name</td>
            <td id="template_name" class="template_name_col_hed">Applied template</td>
        </tr>
        <?php
          $slNo = 1;
          foreach ( $form_list as $form_lists ) {

            <tr id="form-<?php echo $form_lists['id']; ?>" class="header_row">
                <td id="<?php echo $slNo; ?>" class="sl_no_col"><?php echo $slNo; ?></td>
                <td id="chk-box-<?php echo $form_lists['id']; ?>" class="sl_no_col_hed">
                    <input name="select_all" id="selectAll-<?php echo $form_lists['id']; ?>" class="" style=""
                           ng-checked="all" ng-model="formId<?php echo $slNo; ?>" type="checkbox"
                           val="<?php echo $form_lists['id']; ?>">
                </td>
                <td id="form-id-<?php echo $form_lists['id']; ?>"
                    class="form_name_col"><?php echo $form_lists['name']; ?></td>
                <td class="template_name_col"></td>
            </tr>
        <?php } ?>
    </table>
</form>
</div>

<script>
var myAdminApp = angular.module('formListApp');

myAdminApp.controller('formListController', function AdminController($scope) {
    $scope.formId = {};

    $scope.applyTemplate = function () {

    }
});
</script>

Allpy模板
序号
全选
表格名称
应用模板
var myAdminApp=angular.module('formListApp');
myAdminApp.controller('formListController',函数AdminController($scope){
$scope.formId={};
$scope.applyTemplate=函数(){
}
});

这是我的代码,我是angular的新手。是否可以获取复选框值?

请参阅此链接:我正在使用数据库获取复选框的值,我无法在angular中存储值。使用angular模型将值存储在angular中。在代码中,使用“formId”存储ng模型。另一方面,您必须在id.ex:document.getElementById(“#id”)的帮助下获取复选框值。checked这是javasript,这意味着使用ng模型是不可能的?无论如何,感谢您的解决方案。使用ng模型您必须使用数据而不是id分配ng模式。然后您可以获取值。请参阅此链接:我正在使用数据库获取值。对于复选框,我无法在angulerng模型中存储值用于在angular中存储值。在代码中,使用“formId”存储ng模型。另一方面,您必须在id.ex:document.getElementById(“#id”)的帮助下获取复选框值。checked这是javasript,这意味着使用ng模型是不可能的?无论如何,感谢您的解决方案。使用ng模型,您必须为ng模型分配数据,而不是id。然后您可以获取值。