Hello, I would like to query some DOM Elements to be able to get the height 
of each element. Based on that height my aim is to rearrange the items so I 
get a "masonry"-like layout. 
The idea is that I can only rearrange the elements after I have the size of 
the DOM-Elements because CSS properties like font-size, padding or margin 
could change height of each DOM-Element and therefore calculating a value 
beforehand is not the best approach.

The layout will contain 2 columns and therefore I just need to split it 
into right or left.
The DOM-Elements can also vary in height because of the length of some 
properties (Contains arrays strings for example).

I created a small demo Application which showcases my problem:

https://stackblitz.com/edit/angular-xzx335

Currently I get the height for each ElementRef by using DI and calling 
nativeElement.offsetHeight in the component (hero-detail.component.ts).
However I want to reduce the function calls to just call  
elementRef.nativeElement on the parent component (app.component) and from 
there query the DOM element height.


In the parent component (AppComponent) I get the complete div (see results 
viewquery). 
But I want to get the properties from children inside that div.

How can I achieve that?

Best regards



-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to