The requested sample is already available in this demonstration application
The application uses page-router-outlet
in its app.component.ts
The example demonstrating how to use the SideDrawer events can be found here
What is happening is that we are getting a reference to the SideDrawer
. In this example, we are using the exposed RadSideDrawerComponent
but you can achieve the same by using Angular id and ElementRef
Example for using Angular id:
// getting reference by using Angular id
@ViewChild("myDrawer') public drawerComponent: ElementRef;
and in the HTML file the id is assigned as follows:
Then we are getting a reference to the NativeScript drawer control
after Angular is loaded (ngAfterViewInit
At this point, we can already use the closeDrawer and openDrawer methods
as shown here.
I hope this information will help you get through - Let me know if you need further assistance on the matter with programmatically opening and closing the drawer.