@web-atoms/core
Version:
35 lines (28 loc) • 1.04 kB
text/typescript
import { App } from "../../../../App";
import { Inject } from "../../../../di/Inject";
import { NavigationService } from "../../../../services/NavigationService";
import { AtomViewModel } from "../../../../view-model/AtomViewModel";
import { AtomTabbedPage } from "../../../controls/AtomTabbedPage";
export default class TabHost extends AtomTabbedPage {
protected create(): void {
this.tabChannelName = "app";
this.viewModel = this.resolve(TabHostViewModel);
}
}
class TabHostViewModel extends AtomViewModel {
constructor(
app: App,
private nav: NavigationService) {
super(app);
}
public async init(): Promise<any> {
await this.nav.openPage("tab://app/web-atoms-core/dist/web/samples/tabs/views/Page1", {
message: "Page 1",
title: "Page 1"
});
await this.nav.openPage("tab://app/web-atoms-core/dist/web/samples/tabs/views/Page1", {
message: "Page 2",
title: "Page 2"
});
}
}