Skip to content

Commit fb44f5a

Browse files
ADjenkovADjenkov
ADjenkov
authored and
ADjenkov
committed
fix(p-r-o): actionBarVisibility has no effect when applied to nested lazy loaded named outlet
1 parent 79451bf commit fb44f5a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
+9-1
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
import { Component } from "@angular/core";
1+
import { Component, ViewChild } from "@angular/core";
22
import { Page } from "tns-core-modules/ui/page";
3+
import { PageRouterOutlet } from "./page-router-outlet";
34
@Component({
45
// tslint:disable-next-line:component-selector
56
selector: "ns-empty-outlet",
67
moduleId: module.id,
78
template: "<page-router-outlet isEmptyOutlet='true'></page-router-outlet>"
89
})
910
export class NSEmptyOutletComponent {
11+
@ViewChild(PageRouterOutlet) pageRouterOutlet: PageRouterOutlet;
1012
constructor(private page: Page) {
1113
if (this.page) {
1214
this.page.actionBarHidden = true;
15+
16+
this.page.on("loaded", () => {
17+
if (this.pageRouterOutlet && this.page.frame) {
18+
this.pageRouterOutlet.setActionBarVisibility(this.page.frame.actionBarVisibility);
19+
}
20+
});
1321
}
1422
}
1523
}

0 commit comments

Comments
 (0)