为什么没有出现ActionBar? Nativescript/Angular2

为什么没有出现ActionBar? Nativescript/Angular2

问题描述:

为什么我的ActionBar没有出现在我的/home页面,当它在我的/login页面上工作?为什么没有出现ActionBar? Nativescript/Angular2

login.component.html

<ActionBar title="Application Title"></ActionBar> 

home.component.html

<ActionBar title="Application Title"></ActionBar> 

发生这种情况时没有错误被抛出。

确保如果你正在创建一个您添加到您的子模块的import语句的NativeScript/Angular2应用程序中的一个子模块:

import {NativeScriptModule} from "nativescript-angular/nativescript.module"; 

在我的情况下,home.component.tshome.component.html一个叫home.module.ts子模块的一部分。

import {NgModule, NO_ERRORS_SCHEMA} from '@angular/core'; 
import {HomeComponent} from "./home.component"; 
import {HomeRoutingModule} from "./home-routing.module"; 
import {NativeScriptModule} from "nativescript-angular/nativescript.module"; 

@NgModule({ 
    imports: [ 
     HomeRoutingModule, 
     NativeScriptModule //<-- this is needed 
    ], 
    declarations: [ 
     HomeComponent 
    ], 
    schemas: [ 
     NO_ERRORS_SCHEMA 
    ] 
}) 
export class HomeModule { 

} 

github nativescript issue #450