I've been seeing a lot of recommendations online about using Angular Material for creating a sidebar, but I'm hesitant to install an entire library just for one component.
After following the instructions provided here, I managed to develop a sidebar component that functions perfectly. The HTML code for this component is quite simple:
<div class='sidebar'>
<ng-content></ng-content>
</div>
The majority of the opening/closing functionality is handled by the controller and the CSS styles.
However, I am now facing a new challenge where I need a form to always be visible in the desktop view (non-sidebar), but it gets confined within the collapsible sidebar when the screen width is reduced.
Many suggestions online advise duplicating the content in both the sidebar and the main layout, then controlling visibility based on screen width. Yet, this approach becomes cumbersome with forms as it requires synchronization of input variables between the duplicated instances.
I am striving to avoid duplicating my form: one version for the sidebar view and another for the non-sidebar view. Ideally, I would like to have a single <form></form>
present in both locations simultaneously. However, I am struggling to find a solution for this issue.