html"
<div id="parent">
<input type=button ng-click="getWidth()">
</div>
js:
function Ctrl($scope) {
$scope.getWidth = function(){
// How to get div[id=parent] width here?
}
}
So my question is how to get parent div in getWidth method?
$documentor$elementinto your controller but better practice would be to put DOM stuff into directives. We could give a better answer if you provide more information would you want to do with parent's width.