为啥模块的导入导出会给出错误,因为声明了“BlogpostModule”但它的值从不读取.ts(6133)“角度7
Posted
技术标签:
【中文标题】为啥模块的导入导出会给出错误,因为声明了“BlogpostModule”但它的值从不读取.ts(6133)“角度7【英文标题】:Why Import export of module is giving error as "BlogpostModule' is declared but its value is never read.ts(6133)" angular 7为什么模块的导入导出会给出错误,因为声明了“BlogpostModule”但它的值从不读取.ts(6133)“角度7 【发布时间】:2020-01-11 13:27:25 【问题描述】:我在模块中创建了组件,并尝试在“app.component.html”中使用简单的html代码输出结果
当我将鼠标悬停在代码上时,它会显示此错误“已声明 BlogpostModule,但它的值从未读取。ts(6133)”
当我删除代码“”时。我看到了输出。
请帮我修复这个空白页。
app.component.html
<div class="container">
<app-header></app-header>
<app-banner></app-banner>
<app-blogpost-featured></app-blogpost-featured>
<app-footer></app-footer>
</div>
<router-outlet></router-outlet>
app.module.ts
import BrowserModule from '@angular/platform-browser';
import NgModule from '@angular/core';
import AppRoutingModule from './app-routing.module';
import BlogpostModule from './blogpost/blogpost.module';
import CmspageModule from './cmspage/cmspage.module';
import AppComponent from './app.component';
import HeaderComponent from './header/header.component';
import FooterComponent from './footer/footer.component';
import BannerComponent from './banner/banner.component';
import PageNotFoundComponent from './page-not-found/page-not-found.component';
@NgModule(
declarations: [
AppComponent,
HeaderComponent,
FooterComponent,
BannerComponent,
PageNotFoundComponent
],
imports: [
BrowserModule,
AppRoutingModule,
CmspageModule,
AppRoutingModule
],
providers: [],
bootstrap: [AppComponent]
)
export class AppModule
blogpost.module.ts
import NgModule from '@angular/core';
import CommonModule from '@angular/common';
import BlogpostRoutingModule from './blogpost-routing.module';
import BlogpostFeaturedComponent from './blogpost-featured/blogpost-featured.component';
import BlogpostListComponent from './blogpost-list/blogpost-list.component';
import BlogpostDetailComponent from './blogpost-detail/blogpost-detail.component';
import BlogpostRecentComponent from './blogpost-recent/blogpost-recent.component';
import CategoriesComponent from './categories/categories.component';
@NgModule(
imports: [
CommonModule,
BlogpostRoutingModule
],
exports: [
BlogpostFeaturedComponent
],
declarations: [BlogpostFeaturedComponent, BlogpostListComponent, BlogpostDetailComponent, BlogpostRecentComponent, CategoriesComponent],
)
export class BlogpostModule
【问题讨论】:
【参考方案1】:您忘记在您的app.module.ts
中包含BlogpostModule
。
【讨论】:
谢谢 Pankaj。我是角度的新手。正在尝试创建一个博客网站!非常感谢。您能否分享您的电子邮件 ID 以进行进一步查询?再次感谢以上是关于为啥模块的导入导出会给出错误,因为声明了“BlogpostModule”但它的值从不读取.ts(6133)“角度7的主要内容,如果未能解决你的问题,请参考以下文章
为啥使用Mysql命令source导入.sql文件时总是出错?