【发布时间】:2018-05-10 17:31:55
【问题描述】:
我正在使用 angular 5 和 Nativescript 做一个应用程序。好吧,在应用程序中,我有不同的页面(组件),它们都有相同的底部菜单,即单个组件。我的问题是如何将参数传递给菜单组件,因为在菜单组件上我需要知道女巫是当前页面,例如为菜单的当前页面项设置一个活动类。
单页示例:
<Page>
<ActionBar title="" class="action-bar">
<StackPanel orientation="horitzontal">
<Label class="action-title" text="Canciones"></Label>
</StackPanel>
</ActionBar>
<StackLayout class="page">
<ListView [items]="filteredSongs" class="songs-listview" (itemTap)="songClick($event)" *ngIf="!isLoading">
<ng-template let-item="item">
<StackLayout>
<Label [text]='item.SON_NAME'></Label>
</StackLayout>
</ng-template>
</ListView>
<StackLayout verticalAlignment="center" *ngIf="isLoading" class="loading-stack">
<ActivityIndicator busy="{{ isLoading }}"></ActivityIndicator>
</StackLayout>
</StackLayout>
<main-menu></main-menu> // THE MENU COMPONENT
【问题讨论】:
标签: android angular mobile nativescript