-
-
Notifications
You must be signed in to change notification settings - Fork 241
/
Copy pathhome.component.ts
72 lines (61 loc) · 2.24 KB
/
home.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import { Component, ViewContainerRef } from "@angular/core";
import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs";
import { RouterExtensions } from "nativescript-angular/router";
import { EventData } from "tns-core-modules/data/observable";
import { ViewContainerRefService } from "../shared/ViewContainerRefService";
import { ModalRouterComponent } from "../modal/modal-router/modal-router.component";
import { ModalComponent } from "../modal/modal.component";
import { ModalViewComponent } from "../modal-shared/modal-view.component";
@Component({
moduleId: module.id,
selector: "home-page",
templateUrl: "./home.component.html"
})
export class HomeComponent {
constructor(
private modal: ModalDialogService,
private vcRef: ViewContainerRef,
private viewContainerRefService: ViewContainerRefService,
private routerExtension: RouterExtensions) { }
onModalNoFrame(args: EventData) {
const options: ModalDialogOptions = {
context: {
navigationVisibility: false
},
fullscreen: true,
viewContainerRef: this.vcRef
};
this.modal.showModal(ModalComponent, options).then((res: string) => {
console.log("moda-no-frame closed");
});
}
onModalFrame(args: EventData) {
const options: ModalDialogOptions = {
context: {
navigationVisibility: true,
modalRoute: "modal"
},
fullscreen: true,
viewContainerRef: this.vcRef
};
this.modal.showModal(ModalRouterComponent, options).then((res: string) => {
console.log("moda-frame closed");
});
}
onNavigateSecond(args: EventData) {
this.routerExtension.navigate(["second"]);
}
onFrameRootViewReset(args: EventData) {
}
onRootModalTap(): void {
const options: ModalDialogOptions = {
viewContainerRef: this.viewContainerRefService.root,
context: {},
fullscreen: true
};
this.modal.showModal(ModalViewComponent, options)
.then((result: string) => {
console.log(result);
});
}
}