如何添加自定义组件,该组件在整个应用程序生命周期中都可用。 当我将其添加到app.component.html页面时,我的网络状态组件不起作用。我的自定义组件具有一个连接状态选择器。我的自定义组件和应用程序组件的片段附在下面。
<!--Custom Component-->
<GridLayout class="online-status" *ngIf="!isOnline">
<Label [text]="connectionMessage" fontSize="9" horizontalAlignment="center" verticalAlignment="middle"></Label>
</GridLayout>
=
<RadSideDrawer [drawerTransition]="sideDrawerTransition" []>
<GridLayout tkDrawerContent rows="auto, *" class="sidedrawer sidedrawer-left">
<StackLayout row="0" class="sidedrawer-header">
</StackLayout <ScrollView row="1">
<StackLayout class="sidedrawer-content">
</StackLayout>
</ScrollView>
</GridLayout>
<page-router-outlet tkMainContent class="page page-content" </page-router-outlet>
</RadSideDrawer>
<connection-status></connection-status>