如何创建一个代码的json angularjs变量,如下所示:
<div class="form-group">
<label for="">Name</label>
<input type="text" name="name" required class="form-control" id="" ng-model="dataInsert.name" placeholder="">
<p ng-show="form.nama.$invalid && !form.nama.$pristine" class="help-block text-danger">Don't Empty.</p>
</div>
<div class="checkbox" ng-repeat="room in rooms">
<label>
<input type="checkbox" name="room" class="flat" ng-model="dataInsert.selectRoom[room.id]"> {{room.room}}
</label>
</div>
使用像这样的php文件
$data = json_decode(file_get_contents("php://input")); $name = $conn->real_escape_string($data->name); $room = $conn->real_escape_string($data->room???);
变量名称运行良好,但我很困惑从$ data-&gt;变量变量室
请帮忙,