-
-
Notifications
You must be signed in to change notification settings - Fork 241
/
Copy pathbottom-navigation.component.ts
68 lines (54 loc) · 1.4 KB
/
bottom-navigation.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { Component, OnInit } from "@angular/core";
@Component({
selector: "bottom-navigation-component",
template: `
<BottomNavigation #bottomNavigation>
<TabStrip>
<TabStripItem title="TabStripItem 0" iconSource="res://icon">
</TabStripItem>
<TabStripItem>
<Label text="TabStripItem 1">
</Label>
<Image src="res://icon">
</Image>
</TabStripItem>
<TabStripItem title="TabStripItem X" iconSource="res://x">
<Label text="TabStripItem 2">
</Label>
<Image src="res://icon">
</Image>
</TabStripItem>
</TabStrip>
<TabContentItem>
<StackLayout>
<Label text="TabContentItem 0">
</Label>
<Button (tap)="goTo(bottomNavigation, 1)" text="go to 1">
</Button>
</StackLayout>
</TabContentItem>
<TabContentItem>
<StackLayout>
<Label text="TabContentItem 1">
</Label>
<Button (tap)="goTo(bottomNavigation, 2)" text="go to 2">
</Button>
</StackLayout>
</TabContentItem>
<TabContentItem>
<StackLayout>
<Label text="TabContentItem 2">
</Label>
<Button (tap)="goTo(bottomNavigation, 0)" text="go to 0">
</Button>
</StackLayout>
</TabContentItem>
</BottomNavigation>
`,
})
export class BottomNavigation implements OnInit {
public ngOnInit(): void { }
goTo(bottomNavigation: any, index: number) {
bottomNavigation.selectedIndex = index;
}
}