小编Nis*_*sin的帖子

AngularJS:如何禁用表单中的所有表单控件?

我想禁用所有表单组件,以便在单击视图按钮时无法编辑它.这是我的表格

<form action="#" class="form-horizontal" >
   <div class="form-group">
      <label for="fieldname" class="col-md-3 control-label">Name</label>
      <div class="col-md-6">
         <input type="text" ng-model="newItem.customSelected" typeahead="name as name.name for name in members | filter:{name:$viewValue}" class="form-control" />
      </div>
   </div>
   <div class="form-group">
      <label for="fieldhname" class="col-md-3 control-label">House name</label>
      <div class="col-md-6">
         <input type="text" ng-model="newItem.customSelected1" typeahead="house_name as house_name.house_name for house_name in family | filter:{house_name:$viewValue}" class="form-control" />
      </div>
   </div>
   <div class="form-group">
      <label for="" class="col-md-3 control-label"><?php echo $this->lang->line('label_family_id'); ?></label>
      <div class="col-md-6">
         <input type="text" ng-model="newItem.customSelected2" typeahead="fm as fm.family_reg_no for fm in family | filter:{family_reg_no:$viewValue}" class="form-control" />
      </div> …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs

20
推荐指数
2
解决办法
2万
查看次数

Angularjs [$ rootScope:inprog] inprogress错误

我收到angularjs [$ rootScope:inprog]错误.

Error: [$rootScope:inprog] http://errors.angularjs.org/1.2.7/$rootScope/inprog?p0=%24digest.

这是函数调用

 Members.get({}, function (response) { // success
   $scope.family_mem = response.data;    
  }, function (error) { // ajax loading error

    Data.errorMsg(); // display error notification
  });
Run Code Online (Sandbox Code Playgroud)

在控制台我通过php控制器功能获得结果.但是没有更新$scope.family_mem而是转到错误部分.这是指令

myApp.directive('mySelect', function() {
  return{
    restrict: 'A',
    link: function(scope, element){
      $(element).select2();
    }
  };
});
Run Code Online (Sandbox Code Playgroud)

javascript php codeigniter angularjs angularjs-scope

20
推荐指数
2
解决办法
4万
查看次数

哪个相机会在移动设备中打开getUserMedia API?前面还是后面?

使用getUserMedia API访问桌面摄像头时,它会打开网络摄像头.当然它有助于视频通信.但是当它在移动设备中使用时调用哪个摄像头.前凸轮或后凸轮?.是否需要选择代码相机?

javascript html5 getusermedia

12
推荐指数
2
解决办法
2万
查看次数

使用angularjs将复选框设置为已选中

我有一些复选框,它们的值在数据库中是'Y'或'N'作为枚举.为了进行更新我必须检查所有复选框.如何查看复选框已选中.这是复选框的代码

<label class="radio-inline">
  <input type="checkbox"  ng-model="newItem.have_voter_id"  value="have_voter_id" /><?php echo $this->lang->line('label_voter_id'); ?>
</label>
<label class="radio-inline">
  <input type="checkbox"   ng-model="newItem.have_passport" value="passport" /> <?php echo $this->lang->line('label_passport'); ?>
 </label>
Run Code Online (Sandbox Code Playgroud)

这是查看和更新​​的功能

 $scope.edit = function(id,family_id) {

    $scope.action = 'update';
    FamilyMem.get({id:id,family_id:family_id}, function (response) { // success            
        $scope.newItem = response.data; // store result to variable            
          $("#myModal").modal('show');
        }, function (error) { // ajax loading error
            Data.errorMsg(); // display error notification
            //$scope.edit = false;
        });
  };
Run Code Online (Sandbox Code Playgroud)

并编辑按钮

  <a href="" class="btn btn-magenta btn-sm" ng-click="edit(family_member.id,family_member.family_id)">
Run Code Online (Sandbox Code Playgroud)

angularjs angularjs-directive angularjs-scope

7
推荐指数
1
解决办法
3万
查看次数

如何缩放和旋转由带有画布的html5 GetUserMedia API流式传输的网络摄像头视频?

我正在使用Html5 GetUserMedia api和画布用于网络摄像头流媒体.在播放视频时我想要缩放,缩小,旋转等我的代码缩放,旋转不起作用.我编码与相同.但他们不使用GetUserMedia API和画布.这是我的代码

    

<canvas id="canvas" width="350" height="600""> </canvas> <div id="buttonWrapper"> <input type="button" id="play" value="pause"> <input type="button" id="plus" value="+"> <input type="button" id="minus" value="-"> <input type="button" id="rotateleft" value="rotate left"> <input type="button" id="rotateright" value="rotate rightt"> </div> <div id="RPHTML5Video" style="position: relative; z-index: -1;"> <video id="video" style="display: none;position:absolute;" autoplay src=""> </video> </div> <script> var video = document.getElementById("video"); var canvas = document.getElementById("canvas"); var ctx = canvas.getContext('2d'); navigator.webkitGetUserMedia({video: true}, function(stream) { video.src = window.URL.createObjectURL(stream); setInterval(function () {ctx.drawImage(video, 14, 110, 300,550); },20); …
Run Code Online (Sandbox Code Playgroud)

javascript html5 canvas html5-video getusermedia

3
推荐指数
1
解决办法
8334
查看次数

为什么 ng-model 没有定义?

我有一个表单中的三个 angular-ui-bootstrap typehead

<form>
<div class="form-group">
   <label for="fieldname" class="col-md-3 control-label">Name</label>
   <div class="col-md-6">
      <input type="text" ng-model="newItem.customSelected" typeahead="name as name.name for name in members | filter:{name:$viewValue}" class="form-control" />
   </div>
</div>
<div class="form-group">
   <label for="fieldhname" class="col-md-3 control-label">House name</label>
   <div class="col-md-6">
      <input type="text" ng-model="newItem.customSelected1" typeahead="house_name as house_name.house_name for house_name in family | filter:{house_name:$viewValue}" class="form-control" />

   </div>
</div>
<div class="form-group">
   <label for="" class="col-md-3 control-label"><?php echo $this->lang->line('label_family_id'); ?></label>
   <div class="col-md-6">
      <input type="text" ng-model="newItem.customSelected2" typeahead="fm as fm.family_reg_no for fm in family | filter:{family_reg_no:$viewValue}" class="form-control" />
   </div>
</div> …
Run Code Online (Sandbox Code Playgroud)

javascript twitter-bootstrap angularjs angular-ui angular-ui-bootstrap

1
推荐指数
1
解决办法
6491
查看次数

使用ng-repeat时如何在特定行的angularjs中隐藏<td>

我有一张桌子和许多<td>s,<tr> </tr>我首先使用的是ng-repeat

  <tr ng-repeat="receipt in $data">
   <td   data-title="voucher number">
    <span>{{receipt.voucher_no}}</span> 
   </td>
    <td   data-title="voucher date" sortable="'voucher_date'" filter="{'voucher_date': 'text' }">
    <span>{{receipt.voucher_date}}</span> 
   </td>
    <td   data-title="voucher Amount">
    <span>{{receipt.voucher_amount}}</span> 
   </td> 
  </tr>  
Run Code Online (Sandbox Code Playgroud)

我也有json数据

{
    "data": [
        {
            "voucher_no": "2",
            "voucher_amount": "100",
            "voucher_date": "2014-05-04",
      },
        {
            "voucher_no": "3",
            "voucher_amount": "1000000",
            "voucher_date": "2014-02-05",
        },
        {
            "voucher_no": "4",
            "voucher_amount": "50000",
            "voucher_date": "2014-02-05",
        },
        .
        .
        .
        .
        {
            "total": 1360100
        }
    ]
}

please note that for final data there is only one field …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs angularjs-directive ng-repeat

1
推荐指数
1
解决办法
5584
查看次数

如何在 WordPress 列表中添加自定义批量操作?

我正在开发一个插件,我必须将用户列入黑名单,因此我需要在“用户”页面的“批量操作”下拉列表中的“删除”选项之后再显示一个名为“黑名单”的下拉项目。但我无法看出这两个操作的来源以及如何将特定用户列入黑名单。

我的想法是在用户表中添加一个字段is_blacklisted 作为具有默认值的布尔值,当应用黑名单 操作时它会更改为 。还有其他想法吗?falsetrue

php wordpress

0
推荐指数
2
解决办法
9050
查看次数