@@ -12,93 +12,22 @@ import { confirm } from "tns-core-modules/ui/dialogs";
1212import { AppModule } from "../app.module" ;
1313
1414@Component ( {
15- moduleId : module . id ,
16- selector : "home-page" ,
17- templateUrl : "./home.component.html"
15+ moduleId : module . id ,
16+ selector : "home-page" ,
17+ templateUrl : "./home.component.html"
1818} )
1919export class HomeComponent {
20- constructor (
21- private modal : ModalDialogService ,
22- private vcRef : ViewContainerRef ,
23- private viewContainerRefService : ViewContainerRefService ,
24- private routerExtension : RouterExtensions ) { }
25-
26- onModalNoFrame ( ) {
27- const options : ModalDialogOptions = {
28- context : {
29- navigationVisibility : false
30- } ,
31- fullscreen : true ,
32- viewContainerRef : this . vcRef
33- } ;
34-
35- this . modal . showModal ( ModalComponent , options ) . then ( ( res : string ) => {
36- console . log ( "moda-no-frame closed" ) ;
37- } ) ;
38- }
39-
40- onModalFrame ( ) {
41- const options : ModalDialogOptions = {
42- context : {
43- navigationVisibility : true ,
44- modalRoute : "modal"
45- } ,
46- fullscreen : true ,
47- viewContainerRef : this . vcRef
48- } ;
49-
50- this . modal . showModal ( ModalRouterComponent , options ) . then ( ( res : string ) => {
51- console . log ( "moda-frame closed" ) ;
52- } ) ;
53- }
54-
55- onNavigateSecond ( ) {
56- this . routerExtension . navigate ( [ "second" ] ) ;
57- }
58-
59- onFrameRootViewReset ( ) {
60- AppModule . root = "page-router" ;
61- AppModule . platformRef . _livesync ( ) ;
62- }
63-
64- onNamedFrameRootViewReset ( ) {
65- AppModule . root = "named-page-router" ;
66- AppModule . platformRef . _livesync ( ) ;
67- }
68-
69- onTabRootViewReset ( ) {
70- AppModule . root = "tab" ;
71- AppModule . platformRef . _livesync ( ) ;
72- }
73-
74- onLayoutRootViewReset ( ) {
75- AppModule . root = "layout" ;
76- AppModule . platformRef . _livesync ( ) ;
77- }
78-
79- onRootModalTap ( ) : void {
80- const options : ModalDialogOptions = {
81- viewContainerRef : this . viewContainerRefService . root ,
82- context : { } ,
83- fullscreen : true
84- } ;
85-
86- this . modal . showModal ( ModalViewComponent , options )
87- . then ( ( result : string ) => {
88- console . log ( result ) ;
89- } ) ;
90- }
91-
92- onShowDialog ( ) {
93- let options = {
94- title : "Dialog" ,
95- message : "Message" ,
96- okButtonText : "Yes" ,
97- cancelButtonText : "No"
98- }
99-
100- confirm ( options ) . then ( ( result : boolean ) => {
101- console . log ( result ) ;
102- } )
103- }
20+ constructor (
21+ private modal : ModalDialogService ,
22+ private vcRef : ViewContainerRef ,
23+ private viewContainerRefService : ViewContainerRefService ,
24+ private routerExtension : RouterExtensions ) { }
25+
26+ onNavigateSecond ( ) {
27+ this . routerExtension . navigate ( [ "second" ] ) ;
28+ }
29+
30+ onNavigateSecondWithOutlet ( ) {
31+ this . routerExtension . navigate ( [ { outlets : { namedRouter :[ "second" ] } } ] ) ;
32+ }
10433}
0 commit comments