angularjs使用BUG收集和解决办法

此文章涉及到时1.X的版本。请注意!
1.关于checkbox和bootstrap不能选中BUG

在使用angularjs的时候,有个比较明显的bug ng-disabled无效的情况

这里是一种情况的bug

<div class="checkbox MLH-specval-item" toggle-class="selected"  ng-class="{'selected':specV.selected == 1}" ng-disabled="{{specV.selected === 1}}"  ng-click="toggleSpec(specInfo.k, specV.v)">
                                        <i></i>
                                        <span>{{specV.v}}</span>
                                    </div>

这种情况下ng-disabled 是无效的,解决办法

<input type="checkbox" class="checkbox MLH-specval-item" toggle-class="selected"  ng-checked="{{specV.selected === 1}}" ng-disabled="{{specV.selected === 1}}"  ng-click="toggleSpec(specInfo.k, specV.v)">

就直接使用原有的控件,不适用angularjs 的 class="checkbox MLH-specval-item",还有其他的也有类似的情况,比如button按钮,无法使用

也可以使用类似方法,直接使用原生控件,在加上bootstrap的样式

这可能是angularjs和bootstrap混合使用出现的BUG,底层原因没有追查,毕竟 我是个后台开发

2.ng-model赋值触发ng-click,ng-focus事件
<input type="text" class="inp-write" ng-model="shop_name" ng-change="changeName()" ng-click="selectedShow=true" placeholder="请输入名称">

在此场景里在text框,点击响应  selectedShow=true,显示一个 ng-model="selectedShow" 的div,但是在给ng-model="shop_name" $scope.shop_name = item.name

赋值的会再次激活ng-click和ng-focus方法,ng-focus我还可以理解,但是为什么要激活ng-click,就有点奇怪,如果要实现点击text框,显示一个下拉框就得使用

ng-mouseenter="selectedShow=true" ng-mouseleave="selectedShow=false"  

只能使用这个方法才能不出bug

The Controller Area Network (CAN) is a serial communications protocol which efficiently supports distributed realtime control with a very high level of security. Its domain of application ranges from high speed networks to low cost multiplex wiring. In automotive electronics, engine control units, sensors, anti-skid-systems, etc. are connected using CAN with bitrates up to 1 Mbit/s. At the same time it is cost effective to build into vehicle body electronics, e.g. lamp clusters, electric windows etc. to replace the wiring harness otherwise required. The intention of this specification is to achieve compatibility between any two CAN implementations. Compatibility, however, has different aspects regarding e.g. electrical features and the interpretation of data to be transferred. To achieve design transparency and implementation flexibility CAN has been subdivided into different layers. • the (CAN-) object layer • the (CAN-) transfer layer • the physical layer The object layer and the transfer layer comprise all services and functions of the data link layer defined by the ISO/OSI model. The scope of the object layer includes • finding which messages are to be transmitted • deciding which messages received by the transfer layer are actually to be used, • providing an interface to the application layer related hardware. There is much freedom in defining object handling. The scope of the transfer layer mainly is the transfer protocol, i.e. controlling the framing, performing arbitration, error checking, error signalling and fault confinement. Within the transfer layer it is decided whether the bus is free for starting a new transmission or whether a reception is just starting. Also some general features of the bit timing are regarded as part of the transfer layer. It is in the nature of the transfer layer that there is no freedom for modifications. The scope of the physical layer is the actual transfer of the bits between the different nodes with respect to all electrical properties. Within one network the physical layer, of course, has to be the same for all nodes. There may be, however, much freedom in selecting a physical layer. The scope of this specification is to define the transfer layer and the consequences of the CAN protocol on the surrounding layers.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值