Determines the preferred size from the given element's dimension and reports it to the router outlet embedding this web content.
As the value for the preferred size, the offset-width
and offset-height
of the element are used, which is the total amount of space
the element occupies, including the width of the visible content, scrollbars (if any), padding, and border.
When the size of the element changes, the changed size is reported to the outlet, which then adaps its size accordingly.
To stop the notifying of the preferred size to the outlet, pass undefined
as the value, which also unsets the preferred size.
If the element is removed from the DOM, the preferred size is reset and reporting suspended until it is attached again. If a new element is set as dimension observer, then the previous one is unsubscribed.
Prerequisites
block
or inline-block
.The element of which the preferred size is to be observed and used as the outlet's size.
Resets the preferred size. Has no effect if no preferred size is set.
Sets the preferred size of this web content. The size is reported to the router outlet embedding this web content and is used as the outlet's size.
Generated using TypeDoc
Allows web content displayed in a
<sci-router-outlet>
to define its preferred size.The preferred size of an element is the minimum size that will allow it to display normally. Setting a preferred size is useful if the outlet is displayed in a layout that aligns its items based on the items's content size.
When setting a preferred size, the outlet containing this microfrontend will adapt its size to the reported preferred size.