我正在编写angularJS指令,在这个指令中我想获得angularJS中的选择列表框scrollHeight值,但它是未定义的.
我怎么能得到这个价值?我可以在jquery中获得这个值.
在你的指令链接功能内:
app.directive("scrollHeightDetector", function() {
return {
restrict : "AEC",
link : function(scope, element, attrs) {
// here you can use element to get the height
var height = element[0].scrollHeight;
}
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5817 次 |
| 最近记录: |