-
Notifications
You must be signed in to change notification settings - Fork 129
/
Copy pathover-navigation.component.ts
49 lines (39 loc) · 1.69 KB
/
over-navigation.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { Component, ViewChild, OnInit, AfterViewInit, ChangeDetectorRef } from "@angular/core";
import { RadSideDrawer } from "nativescript-ui-sidedrawer";
import { RadSideDrawerComponent } from "nativescript-ui-sidedrawer/angular";
import { Router } from '@angular/router';
@Component({
moduleId: module.id,
selector: "tk-sidedrawer-over-navigation",
templateUrl: 'over-navigation.component.html',
styleUrls: ['over-navigation.component.css']
})
export class SideDrawerOverNavigationComponent implements AfterViewInit, OnInit {
private _mainContentText: string;
constructor(private _router: Router, private _changeDetectionRef: ChangeDetectorRef) {
}
@ViewChild(RadSideDrawerComponent) public drawerComponent: RadSideDrawerComponent;
private drawer: RadSideDrawer;
ngAfterViewInit() {
this.drawer = this.drawerComponent.sideDrawer;
this._changeDetectionRef.detectChanges();
}
ngOnInit() {
this.mainContentText = "SideDrawer for NativeScript can be easily setup in the HTML definition of your page by defining tkDrawerContent and tkMainContent. The component has a default transition and position and also exposes notifications related to changes in its state. Swipe from left to open side drawer.";
}
get mainContentText() {
return this._mainContentText;
}
set mainContentText(value: string) {
this._mainContentText = value;
}
public openDrawer() {
this.drawer.showDrawer();
}
public onCloseDrawerTap() {
this.drawer.closeDrawer();
}
public goToSecondPage() {
this._router.navigateByUrl("SideDrawerOverNavigationComponent/SecondSideDrawerOverNavigationComponent");
}
}