前端那些年遇到的坑

1、透明度opacity属性会被子元素继承,而且子元素重新设置opacity属性会不起作用;

    若不想子元素继承父元素的透明度可通过backgroud-colorl来设置背景颜色的透明度,如background-color: rgba(0,0,0,0.5);

2、ng-repeat里面的ng-module的作用域是ng-repeat这个子作用域的$scope,不属于ng-controller中的$scope,所以ng-module绑定数据时要在变量前面加上$parent才能在ng-controller中的$scope中获取;

    如在html代码中的ng-module设置为:ng-module="$parent.hello",在controller中就可以用$scope.hello来改变和获取hello变量的值。

原文地址:https://www.cnblogs.com/zhxling/p/5699215.html