Angular Ionic v4登录页错误地扩展了基类,超级注入器调用未定义
我正在尝试使用ionic v4的基类,使用以下脚本添加我在应用程序中使用的所有服务: 对于基类:Angular Ionic v4登录页错误地扩展了基类,超级注入器调用未定义,angular,ionic-framework,ionic4,Angular,Ionic Framework,Ionic4,我正在尝试使用ionic v4的基类,使用以下脚本添加我在应用程序中使用的所有服务: 对于基类: import { Injectable } from '@angular/core'; @Injectable() export abstract class BaseClass { constructor(private gateway: GatewayService){ } } 在登录页面中,我使用了超级注射器: export class LoginPage extends Base
import { Injectable } from '@angular/core';
@Injectable()
export abstract class BaseClass {
constructor(private gateway: GatewayService){
}
}
在登录页面中,我使用了超级注射器:
export class LoginPage extends BaseClass implements OnInit {
loginForm: FormGroup;
message: string="";
constructor(private gateway: GatewayService) {
super(gateway);
}
...
}
我遇到的两个问题是:
constructor(private injectorObj: Injector, private gateway: GatewayService){
this.gateway = this.injectorObj.get(GatewayService);
}
但是仍然有相同的错误使网关属性受保护。在两个构造函数上