我刚刚将我的应用从Angular 8升级到Angular 9。在这个版本(9)中,使用Angular特性的类必须有一个合适的Angular装饰器。但是,我有一个组件是@Component({...})。但是在我运行ng serve的地方,它告诉我: The class 'MyComponent' is listed in the declarations of the NgMod
我试图将每个router.navigateByUrl封装在一个类的函数中,并计划在相关位置调用该函数。但这样做,抛出“提供的参数不匹配任何特征的调用目标”。我跟踪了很少的其他链接,但似乎对我的情况没有任何帮助。homePage will be called instead of
import {Router} from '@angular<
我最近将我的项目从角9升级到了角10,现在在类中添加一个装饰器是必须的。我有一个没有装饰器的模型类。它也是一个TypeScript文件。假设我有以下模型 model: string; year: string;现在,当我运行ng serve时,它会抛出类缺少一个装饰器具体错误如下:
NG2007: Class is using
我得到了以下关于类UserAddComponent声明的错误: ERROR in src/app/user/user.module.ts:10:37 - error NG6001: The classIs it missing an Angular annotation?of AppModule, but ~~~~~~~~~~ 有两个文件是有问题的<