angular11报错Can't bind to 'ngForOf' since it isn't a known property of 'tr'. 三种排查办法以及解决方案
当你遇到Can't bind to 'ngForOf' since it isn't a known property of 'tr'. (" //无法绑定到“ngforof”,因为它不是“tr”的已知属性。(“
可能问题一:
当前错误原因是没有绑定ngforof,在@ngmodule()中添加browsermodule到imports:[],如果它是根模块(appmodule),则为commonmodule。
简而言之,就是根部app.module有没有导入这个基础模块,检查一下
可能问题二:出现此问题是你的导入有误,修改BrowserModule在控制器的位置
import {BrowserModule, CommonModule} from '@angular/common';
..
..
@NgModule({
imports: [BrowserModule, /* or CommonModule */],
..
})
可能问题三: 检查一下你的页面是否在当前自己所属模块执行了以下操作
举例:当前模块名字叫做 aa-management
aa-management模块下,当前页面名字叫做report
首先检查这个aa-management.module.ts代码
import { NgModule, Type } from '@angular/core';
import { SharedModule } from '@shared';
import { ManagementRoutingModule } from './hr-management-routing.module'; // 看看有没有这样一行代码-------1
import { HrReportComponent } from './hr-report/hr-report.component'
const COMPONENTS: Type<void>[] = [
HrReportComponent
];
@NgModule({
imports: [
SharedModule,
ManagementRoutingModule // 看看有没有这样一行代码-------2
],
declarations: COMPONENTS,
})
export class ManagementModule { }
然后检查一下:hr-management-routing.module.ts
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ReportComponent } from './hr-report/hr-report.component' // 看看有没有这样一行代码-------3
const routes: Routes = [
{ path: 'report', component: ReportComponent }, // 看看有没有这样一行代码-------4
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ManagementRoutingModule { }
如果以上都没问题,就OK
angular11报错Can't bind to 'ngForOf' since it isn't a known property of 'tr'. 三种排查办法以及解决方案的更多相关文章
- Angular 报错 Can't bind to 'formGroup' since it isn't a known property of 'form'
错误描述 当form表单加FormGroup属性时报错 Can't bind to 'formGroup' since it isn't a known property of 'form' < ...
- VS发布网站时,报错提示:“未能将文件xxx复制到xxx,未能找到文件xx”三种解决方案!
发布网站时候大家可能会遇到这样的情况,就是报错提示说:“未能将文件xxx复制到xxx,未能找到文件xx”,这个问题一般来说有三种解决方案,个人倾向第三种,如图: 解决方案如下: 方案一.把系统提示缺失 ...
- 运行tomcat,报错:Socket bind failed: [730048] ?????????×???(Э?é/???????/???)????í??错误
运行tomcat时,报错: Socket bind failed: [730048] ?????????×???(Э?é/???????/???)????í??错误 原因分析: 这是因为之前已开启了一 ...
- idea 报错javax/xml/bind/DatatypeConverter
idea 报错javax/xml/bind/DatatypeConverter java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeCon ...
- fiddler启动报错Unable to bind to port [8888],ErrorCode:10106
启动运行fiddler 报错,提示Unable to bind to port [8888],ErrorCode:10106 解决方式: 使用Fiddler或其他类似的监听工具出现这种错误时, Una ...
- springBoot配置druid监控报错Failed to bind properties under 'spring.datasource.druid' to javax.sql.DataSource
报错信息: Description: Failed to bind properties under 'spring.datasource.druid' to javax.sql.DataSource ...
- dubbo启动报错failed to bind nettyserver on
dubbo报错 今天启动项目的时候,关掉了custom服务, <dubbo:consumer check="false"/> 并且关掉了spring的elastic-j ...
- angular11 报错 ERROR Error: If ngModel is used within a form tag, either the name attribute must be set or the form
angular 报错 ERROR Error: If ngModel is used within a form tag, either the name attribute must be set ...
- ASP.NET MVC 程序 报错“CS0012: 类型“System.Data.Objects.DataClasses.EntityObject”在未被引用的程序集中定义”的解决办法
运行MVC程序,具体报错信息如下: 解决方法: 打开Web.config在assemblies下加入<add assembly="System.Data.Entity, Version ...
随机推荐
- 【多服务场景化解决方案】AR虚拟技术助力智能家装
1 .介绍 总览 本应用采用了华为图形引擎服务的AR虚拟技术,您可以在手机相机里摆放想要购置的家具家电,交互式体验让您可以轻松操控它们的3D图例,以此来确定这些家具家电是否适合摆放在您的家里. 特 ...
- 一键生成CA证书
create_cert () { cd /etc/openvpn/easy-rsa ./easyrsa gen-req ${NAME} nopass <<EOF EOF cd /etc/o ...
- oracle日常命令
---查询锁表(查出后,再执行查询结果进行释放:可多次查询,存在循环锁表的情况)-- select 'alter system kill session '|| ''''|| sess.sid || ...
- Git创建、diff代码、回退版本、撤回代码,学废了吗
.eye-care { background-color: rgba(199, 237, 204, 1); padding: 10px } .head-box { display: flex } .t ...
- 【实操日记】使用 PyQt5 设计下载远程服务器日志文件程序
最近通过 PyQt5 设计了一个下载服务器指定日期日志文件的程序,里面有些有意思的技术点,现在做一些分享. PyQt5 是一套 Python 绑定 Digia Qt5 应用的框架,是最强大的 GUI ...
- Linux内核替换的一种简单方法
前言 使用现有centos的镜像,在海光机器上出现了无法运行的情况,grub引导后就只剩下光标一直在闪,无任何字符输出.这种情况大概率是因为Linux的内核无法运行在海光的CPU上所导致的. 已得知L ...
- 重启redis
[root@lecode-dev-001 packages]# /usr/local/redis/bin/redis-cli -p 6379 127.0.0.1:6379> auth Redis ...
- i春秋Fuzzing
先查看源码...没东西,抓包 发现也没什么,但是右边有个提示hint: ip,Large internal network(最大内网ip) 可能需要我们伪造代码进行访问,这还不简单,直接在reques ...
- 简单的sql注入3
仍然 1 1' 1" 发现1'报错了.....我觉得作者对'情有独钟 再试试 1# 1'# 1"# 发现都可以正常登录 试试1' and '1'='1和1' and '1'='2发 ...
- 简单的sql注入1
首先查看源码找找思路 发现源码里什么都没有 再使用bp拦截下数据 多次拦截后发现我们在 输入框里输入的等下就是id= 意思是我们这里就可以直接使用get注入了 好像类似于sql-labs上的?id= ...