Global Sidedrawer component


#1

Is it possible with nativescript-telerik-ui to have a single global sidemenu that can be trigged from any page, or does each page have to contain it’s own markup?


#2

Note: My answer is dependent on you using Angular.

You should be able to have a global side drawer component. You will need to specify the component on the same level as your router-outlet or page-router-outlet. You would then use either a shared service among your components to handle access to the side drawer from the children, or manage the “state” of your side drawer in @ngrx/store or equivalent. If all you are doing is toggling the side drawer globally, the service/state option may not be needed.

<telerik-side-drawer-component></telerik-side-drawer-component>
<!-- Top Level Router Outlet -->
<router-outlet></router-outlet>

Obviously replacing the telerik-side-drawer-component with the correct component selector.


#3

Excellent, thanks for the reply! This is another one of those things that is relatively obvious once you see the answer… and also missing from the Telerik-UI docs!