angular - *ngFor 在我添加引导程序之前工作,现在一切都坏了
问题描述
ngForOf
嵌入式模板上的任何指令均未使用属性绑定。确保属性名称拼写正确并且所有指令都列在"@NgModule.declarations"
<div *ngFor="let post of posts" class="post-preview">
<h1 (click)="goToPost(post)" class="post-title">{{post.title}}</h1>
<p class="post-description">{{post.description}}</p> </div>
在我使用引导程序添加样式之前一切正常
npm i -s bootstrap
解决方案
添加引导程序后;我添加imports: [CommonModule, ...],
到我的家庭模块和工作再次。在添加引导程序之前,我刚刚CommonModule
导入app.module.ts
推荐阅读
- firebase - Firebase 批量写入
- java - 如何在freemarker中获取重复的键值?
- python - 如何在python中为文件夹中的每个文件执行tshark
- bash - 如何将所有 git repo 从目录推送到 shellscript 中的 git
- java - 无法使用 Selenium WebDriver 定位现有元素
- c++ - 使用带有 Rcpp 的 C++ 类从 C 或 R 修改它
- html - 蒙面的 svg 元素不显示整个 svg 项目
- python - “Groupby”到多个数据框
- flutter - 颤动中的堆栈是否存在屏幕问题
- angular - Angular - 从扩展类调用函数