我正在构建一个角度4应用程序.我收到错误组件HomeComponent没有任何NgModule的部分或模块尚未导入到你的模块.我创建了HomeModule和HomeComponent.我需要在AppModule中引用哪一个.我有点困惑.我是否需要参考HomeModule或HomeComponent.最终我要找的是当用户点击主菜单时,他应该被定向到将在索引页面上呈现的home.component.html.
App.module
Error:Component HomeComponent is not part of any NgModule or the module has not been imported into your module.
Run Code Online (Sandbox Code Playgroud)
HomeModule
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http'
import { AppComponent } from './app.component';
import { NavbarComponent } from './navbar/navbar.component';
import { TopbarComponent } from './topbar/topbar.component';
import { FooterbarComponent } from './footerbar/footerbar.component';
import { MRDBGlobalConstants } from './shared/mrdb.global.constants';
import { AppRoutingModule } from …Run Code Online (Sandbox Code Playgroud) 我在参与一个有角度的项目时遇到了这个错误。我不明白我该怎么办。任何人都可以帮助我吗?
SCRIPT5022: Template parse errors:
'mdb-navbar-brand' is not a known element:
1. If 'mdb-navbar-brand' is an Angular component, then verify that it is part of this module.
2. If 'mdb-navbar-brand' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
Run Code Online (Sandbox Code Playgroud) 我想为我的模块设置延迟加载,但有一个我无法解决的错误。
错误是:
core.js:15724错误错误:未捕获(承诺中):错误:找不到模块“app/invoice-builder/invoice-builder.module”错误:找不到模块“app/invoice-builder/invoice-builder.module”
应用程序路由.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [
{
path: 'invoice-builder',
loadChildren : 'app/invoice-builder/invoice-builder.module#InvoiceBuilderModule'
},
{
path: '**',
redirectTo: 'invoice-builder'
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
Run Code Online (Sandbox Code Playgroud)
应用程序模块.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import { …Run Code Online (Sandbox Code Playgroud) 我ng2-smart-table在我的项目中用作表格。您可以在下面看到它。
但是我想view在表格的每一行的末尾添加一个为此命名的自定义按钮。以及我想在单击view按钮时打开一个新组件。那么我应该为此做什么。我尝试如下。但不是成功。
add: {
addButtonContent: '<i class="nb-plus"></i>',
createButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
confirmCreate: true
},
edit: {
editButtonContent: '<i class="nb-edit"></i>',
saveButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
confirmSave: true
},
delete: {
deleteButtonContent: '<i class="nb-trash"></i>',
confirmDelete: true
},
view:{
viewButtonContent:''
},
Run Code Online (Sandbox Code Playgroud) 我正在处理角度项目。我想AngularFireStorage导入这种类型的import { AngularFireStorage } from 'angularfire2/storage';
为此我尝试通过此命令npm i angularfire2但出现错误。我在教程中看到一篇文章是这样描述的。"AngularFire has moved, we're now @angular/fire"这是什么意思?是意图npm i angularfire2不起作用还是什么?但是我如何使用import { AngularFireStorage } from 'angularfire2/storage';来实现AngularFireStorage我的项目?