Zaw
Zaw

Reputation: 11

Embedding SideDrawer in NativeScript with Angular

I am developing mobile app by using nativescript with angular. I want to use side drawer in my application. I found some samples online. Those all are for the whole application. I want to exclude Side Drawer for one module such as login module. If you have some experiences with that, please share me.

Thanks & Best Regards, Zaw Zaw Naing

Upvotes: 0

Views: 414

Answers (1)

Nick Iliev
Nick Iliev

Reputation: 9670

You can still use the whole-app examples and create your sidedrawer as a root component. Then in pages where you need to hide the sidedrawer (e.g. like login page), you could get the reference and disable the drawer interaction (this way make it inaccessible). Example of the above here

TypeScript

import { getRootView } from "tns-core-modules/application";
import { RadSideDrawer } from "nativescript-ui-sidedrawer";

// use this in ngAfterViewInit 
// example: https://github.com/NickIliev/nativescript-ng-cosmos/blob/master/app/pages/login/login.component.ts#L43-L44
this.drawer = <RadSideDrawer>getRootView();
this.drawer.gesturesEnabled = false;

Upvotes: 2

Related Questions