The people, there was such a question. It is necessary to bind the height of the image to the height of the text block (element p). The problem is that they are in different $ scope. What is the best way to do this? With Angular is not very familiar. If everything is clear about the height (getBoundingClientRect), then we have not yet fully figured out the areas of visibility.

  • Add an example of markup and your code - Grundy

2 answers 2

Can I have a code sample? If the problem is that they are in different controllers, then it is better to use some sharedService, well, or at worst $ rootScope

    .outerHeight ()

    <div ng-repeat="whatever in items" outer-height></div> 
     app.directive('outerHeight', function(){ return{ restrict:'A', link: function(scope, element){ console.log(element.outerHeight()); } }; });