Skip to content

Commit 0e652e2

Browse files
committed
Review fixes
1 parent 3f5e888 commit 0e652e2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/app/app.component.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class MyApp {
2525
rootPage: any = HomePage;
2626
activePage = new Subject();
2727

28-
pages: Array<{ title: string, component: any, active: Boolean }>;
28+
pages: Array<{ title: string, component: any, active: boolean }>;
2929
state: any;
3030

3131
constructor(public platform: Platform, public global: AppState) {
@@ -45,9 +45,10 @@ export class MyApp {
4545
{ title: 'Theming', component: ThemingPage, active: false },
4646
];
4747

48-
this.activePage.subscribe((value: any) => {
49-
this.pages.map(x => x.active = false);
50-
this.pages[this.pages.findIndex(x => x.title === value.title)].active = true;
48+
this.activePage.subscribe((selectedPage: any) => {
49+
this.pages.map(page => {
50+
page.active = page.title === selectedPage.title;
51+
});
5152
});
5253
}
5354

0 commit comments

Comments
 (0)