Sidedrawer with dynamic content


#1

I am trying to implement multiple sidedrawers with different content. I have succeeded in opening the sidedrawer in different locations but the content stays the same. I followed the blog articles but it seems as though with version 4 and being able to call it from a page directly boggles me a bit.

My try: https://play.nativescript.org/?template=play-ng&id=QgoOAr&v=707

Any direction pointing will be greatly appreciated.


#2

Your playground seems to be working as expected, may I ask what exactly your issue here.


#3

I may not have been clear, when I select the button to open the left side, it should show the left content. If the button to open the drawer in the ‘Right’ location, it should display the right side content.


#4

Try this,

    get currentLocation() {  
        return this.drawerComponent.sideDrawer.drawerLocation;
    }

    set currentLocation(value: SideDrawerLocation) {
        this.drawerComponent.sideDrawer.drawerLocation = value;
    }

#5

Thank you kind sir, it works as expected now :smiley: