难道element.width()不工作了还是我错以为它给你宽度的元素?
angular.module('app', []).directive('app', function() {
return {
restrict: 'E',
link: function(scope, element) {
console.log(element.width());
// => Error: element.width is not a function
},
};
});Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="app">
<app></app>
</div>Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3398 次 |
| 最近记录: |