angular 报错笔记

1、错误信息:

Failed to instantiate module app due to:
Error: [$injector:unpr] http://errors.angularjs.org/1.5.8/$injector/unpr?p0=showE...
    at http://localhost:6664/hospital/assets/js/angular.min.js?v=1499753083736:6:412
    at http://localhost:6664/hospital/assets/js/angular.min.js?v=1499753083736:43:174
    at d (http://localhost:6664/hospital/assets/js/angular.min.js?v=1499753083736:40:432)
    at e (http://localhost:6664/hospital/assets/js/angular.min.js?v=1499753083736:41:158)
    at Object.invoke (http://localhost:6664/hospital/assets/js/angular.min.js?v=1499753083736:41:243)
    at d (http://localhost:6664/hospital/assets/js/angular.min.js?v=1499753083736:39:418)
    at http://localhost:6664/hospital/assets/js/angular.min.js?v=1499753083736:40:19
    at q (http://localhost:6664/hospital/assets/js/angular.min.js?v=1499753083736:7:355)
    at g (http://localhost:6664/hospital/assets/js/angular.min.js?v=1499753083736:39:319)
    at cb (http://localhost:6664/hospital/assets/js/angular.min.js?v=1499753083736:43:336


2、错误信息
$apply already in progress
HTML代码:
  <input type="checkbox" id="check" ng-checked="checkVal" ng-click="select($event)">
  <input type="checkbox" id="check1" class="checked" ng-click="toTrue($event,'dd')">
JS代码:
var array = [];
$scope.checkVal = true;
$scope.checkVal1 = false;

$scope.select = function (event) {
var ele1 = document.getElementById('check1');
ele1.click();
};

$scope.toTrue = function (event,val) {
if(event.target.checked){
array.push(val);

}else{
array.push('0');
}
}

点击第一个checkbox就会报上面的错误信息,但是如果我把第二个checkbox的点击事件去掉就不会报错,哪位大神可以帮我解释一下原因吗?

 

 

转载于:https://www.cnblogs.com/zq123/p/7150243.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值