- If the demo apps cannot help and there is no issue for your problem, tell us about it
Hi! As mentioned in the tile, if I select in the bottom bar a BottomBarItem, the route works, BUT, the home (in my app, the dashboard) gets always selected. Here is my code:
`import { Component, OnInit } from "@angular/core";
import { RadSideDrawer } from "nativescript-ui-sidedrawer";
import * as app from "tns-core-modules/application";
import {
BottomBar,
LABEL_VISIBILITY,
TabSelectedEventData
} from "nativescript-bottombar";
import { Router } from "@angular/router";
@component({
moduleId: module.id,
selector: "aktuelle-module",
templateUrl: "./aktuelle-module.component.html"
})
export class AktuelleModuleComponent implements OnInit {
globalVariables: any = global;
private bottomBar: BottomBar;
labelVisibility: LABEL_VISIBILITY;
actualModules: any[];
constructor(private router: Router) {
this.labelVisibility = LABEL_VISIBILITY.SELECTED;
this.actualModules = this.globalVariables.actualModules;
}
ngOnInit() {}
onDrawerButtonTap() {
const sideDrawer = <RadSideDrawer>app.getRootView();
sideDrawer.showDrawer();
}
async tabSelected(event: TabSelectedEventData) {
const tabbedIcon = event.newIndex;
if (tabbedIcon === 0) {
await this.router.navigate(["/dashboard"]);
}
if (tabbedIcon === 1) {
await this.router.navigate(["/aktuelle-module"]);
}
if (tabbedIcon === 2) {
await this.router.navigate(["/credits"]);
}
if (tabbedIcon === 3) {
await this.router.navigate(["/info"]);
}
}
barLoaded(event) {
this.bottomBar = event.object;
}
}
`
So when i click to 'aktuelle-module' the routing works, but the dashboard gets selected.
Also, here the template of 'aktuelle-module'
`
<ScrollView height="90%">
<StackLayout class="form">
<StackLayout *ngFor="let currentModule of actualModules; index as i">
<GirdLayout rows="auto, auto" columns="auto" class="gridActualModules">
<GridLayout *ngIf="currentModule['Code'] !== ''" row="0" rows="auto" columns="4*, 6*">
<Label fontWeight="bold" textWrap="true" row="0" col="0" text="Code"></Label>
<Label row="0" col="1" [text]="currentModule['Code']"></Label>
</GridLayout>
<GridLayout *ngIf="currentModule['Course'] !== ''" row="1" rows="auto" columns="4*, 6*">
<Label fontWeight="bold" textWrap="true" row="0" col="0" text="Modulname"></Label>
<Label textWrap="true" row="0" col="1" [text]="currentModule['Course']"></Label>
</GridLayout>
</GirdLayout>
<StackLayout class="hr-light"></StackLayout>
</StackLayout>
</StackLayout>
</ScrollView>
<BottomBar (tabSelected)="tabSelected($event)" [androidLabelVisibility]="labelVisibility" (loaded)="barLoaded($event)">
<BottomBarItem icon="res://home" title="Dashboard" checkedIcon="res://home"></BottomBarItem>
<BottomBarItem icon="res://document" title="Aktuelle Module" checkedIcon="res://document"></BottomBarItem>
<BottomBarItem icon="res://credits" title="Credits" checkedIcon="res://credits"></BottomBarItem>
<BottomBarItem icon="res://info" title="Info" checkedIcon="res://info"></BottomBarItem>
</BottomBar>
`
- Which platform(s) does your issue occur on?
Android
emulator AND device. NEXUS ONE API 27
I'd Appreciate any help!
If there are more infos necessary, please tell me!
Hi! As mentioned in the tile, if I select in the bottom bar a BottomBarItem, the route works, BUT, the home (in my app, the dashboard) gets always selected. Here is my code:
`import { Component, OnInit } from "@angular/core";
import { RadSideDrawer } from "nativescript-ui-sidedrawer";
import * as app from "tns-core-modules/application";
import {
BottomBar,
LABEL_VISIBILITY,
TabSelectedEventData
} from "nativescript-bottombar";
import { Router } from "@angular/router";
@component({
moduleId: module.id,
selector: "aktuelle-module",
templateUrl: "./aktuelle-module.component.html"
})
export class AktuelleModuleComponent implements OnInit {
globalVariables: any = global;
private bottomBar: BottomBar;
labelVisibility: LABEL_VISIBILITY;
actualModules: any[];
}
`
So when i click to 'aktuelle-module' the routing works, but the dashboard gets selected.
Also, here the template of 'aktuelle-module'
`
`
Android
emulator AND device. NEXUS ONE API 27
I'd Appreciate any help!
If there are more infos necessary, please tell me!