Angularjs .scope()
Angularjs在有jquery的情况下可以用$().scope()取出某个dom元素的scope,没有的jquery也可用Angularjs自带的jqLite选取
使用示例:
var financialsBlockEle=document.getElementById('financialsBlock'); $('#financialsBlock').scope().$watch( function(){ return financialsBlockEle.clientHeight; }, function(newvalue, oldvalue){ if(newvalue>30){ financialsBlockEle.style.cssText="padding:15px; border-bottom: 1px solid #eee;"; } } );
angular.element("#financialsBlock").scope()