加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Angular 4找不到名称’ViewChild’

发布时间:2020-12-17 07:34:38 所属栏目:安全 来源:网络整理
导读:我有这个奇怪的错误,并没有发现任何类似的东西.. 我在我的网站上使用ng2-canvas-whiteboard组件作为绘图画布,除了当我尝试使用以下方法引用该画布时,一切都正常工作: @ViewChild('canvasWhiteboard') canvasWhiteboard: CanvasWhiteboardComponent; 正如官
我有这个奇怪的错误,并没有发现任何类似的东西..
我在我的网站上使用ng2-canvas-whiteboard组件作为绘图画布,除了当我尝试使用以下方法引用该画布时,一切都正常工作:
@ViewChild('canvasWhiteboard') canvasWhiteboard: CanvasWhiteboardComponent;

正如官方文档建议的那样,我收到了这个错误:

Failed to compile.

e:/frontend/src/app/components/user/dashboard/dashboard.component.ts (15,2): Cannot find name 'ViewChild'.

有什么建议 ?谢谢

您在使用之前忘记导入ViewChild
import { ViewChild } from '@angular/core'

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读