Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 尝试迁移到Angular 9时出错:使用DI迁移的未装饰类_Javascript_Angular_Typescript_Angular9 - Fatal编程技术网

Javascript 尝试迁移到Angular 9时出错:使用DI迁移的未装饰类

Javascript 尝试迁移到Angular 9时出错:使用DI迁移的未装饰类,javascript,angular,typescript,angular9,Javascript,Angular,Typescript,Angular9,我正在尝试从Angular 8迁移到Angular 9,并在步骤中得到以下错误:使用DI迁移的未修饰类。 无法迁移所有使用依赖项的未修饰类 注射。由于以下原因,无法分析某些项目目标: 类型脚本程序失败 错误:错误TS100:src\app\app.module.ts(107,25):在“AppModule”的模板编译过程中出错 函数调用在decorators中不受支持,但在“appReducers”中调用了“combinereducer” “程序”在src\app\store\reducers\

我正在尝试从Angular 8迁移到Angular 9,并在步骤中得到以下错误:使用DI迁移的未修饰类。

无法迁移所有使用依赖项的未修饰类 注射。由于以下原因,无法分析某些项目目标: 类型脚本程序失败

错误:错误TS100:src\app\app.module.ts(107,25):在“AppModule”的模板编译过程中出错 函数调用在decorators中不受支持,但在“appReducers”中调用了“combinereducer” “程序”在src\app\store\reducers\index.ts(13,10)中引用了“modelReducer” “modelReducer”在src\app\store\reducers\model.ts(25,29)处调用“CombineReducer”


知道我为什么会出现这个错误吗?

您很可能需要用
@Injectable()

例:

我个人会推迟使用9,直到它成为GA(由于以前在主要版本中的经验)。但是,“DI”和“未装饰类”对我来说尖叫着“你错过了可注入的装饰器”

你是从8.x升到9吗

@Injectable()
class MyClass {
  constructor(someService: SomeService) {...}
}