未捕获的TypeError:如果没有"new",则无法调用类构造函数平台 [英] Uncaught TypeError: Class constructor Platform cannot be invoked without 'new'

查看:175
本文介绍了未捕获的TypeError:如果没有"new",则无法调用类构造函数平台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Angular CDK,以便使用PrimeNG的下拉组件,但是会引发错误.

I've installed the Angular CDK in order to use PrimeNG's dropdown component but it throws an error.

我已经在我的app.module.ts中添加了它:

I've added this in my app.module.ts:

import {DropdownModule} from 'primeng/dropdown';

只需输入以下内容并安装Angular CDK:

And installed the Angular CDK by simply typing in the following:

npm install @angular/cdk --save

推荐答案

我遇到了同样的问题.在package.json中检查您的cdk版本

I had the same issue. Check your cdk version in your package.json

我解决了安装旧版本的cdk 10的问题:

I solved installing an older version of cdk 10:

npm i @angular/cdk@9.2.4 --save

这篇关于未捕获的TypeError:如果没有"new",则无法调用类构造函数平台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆