title: Angular 2: Add elements to dom programmatically with viewencaptulation
body: <p>I am working on a context menu where I need to get the size of the menu and every sub menu before rendering. The way I have done this in the past is to append a element structure to the dom, compute bbox, line height, etc. And then remove it, so it will never be visible for the user. </p>
  
  <p>From this operation I get everything I need to check if the menu goes outside screen, etc. Then maybe make changes to it.</p>
  
  <p>In angular 2 I am able to do this if ViewEncaptulation is set to None. But I get an error in my current build setup if I use it, so I am stuck to the default value.</p>
  
  <p>Does anyone know how I can make an element programmatically and make it get the same classes from inside the ViewEncaptulation?</p>