I used code from nativescript-ui-samples-angular repo for RadSideDrawer (side menu). It works perfectly, but when I tried wrapping it all in a separate component which I then add into other component via selector it falls flat.
@ViewChild(RadSideDrawerComponent) public drawerComponent: RadSideDrawerComponent;
private drawer: SideDrawerType;
ngAfterViewInit() {
this.drawer = this.drawerComponent.sideDrawer;
this._changeDetectionRef.detectChanges();
}
It says
Cannot read property 'sideDrawer' of undefined
Am I missing something? The problem is not in the side-menu itself, it's the wrapping it into a reusable component.