我正在将Angular应用程序从Angular 5(5.2.1)升级到Angular 6(6.1.9),现在遇到错误,我无法在5.2.1下运行。错误是:
“路由器”类型的参数无法分配给类型的参数 '路由器'。类型具有私有财产的单独声明 'rootComponentType'。
以下是在(app.sandbox.ts)中发生错误的文件的相关位:
import { Router } from '@angular/router';
import { MyActivity } from '@my/my-core';
@Injectable()
export class AppSandbox extends BaseSandbox {
public activity: MyActivity;
public httpLogger: MyHttpLogger;
constructor(
private appService: AppService,
private router: Router,
private httpService: MyHttpService,
private consoleLogger: MyConsoleLogger,
private _httpLogger: MyHttpLogger
)
this.activity = new MyActivity(this.router, loggingServices);
错误发生在myActivity调用中的“ this.router”参数上。
有什么办法解决吗?
以下是MyActivity类定义的摘要:
export declare class MyActivity {
private router;
private loggingServices;
constructor(router: Router, loggingServices: Array<any>);