当我运行build -prod时,我收到以下警告.
原文链接:https://www.f2er.com/angularjs/141041.htmlWarning: Can't resolve all parameters for UsersPermissionsService in C:/SourceControl/Test.Client/src/app/shared/users/users-permissions.service.ts: (?,?,?). This will become an error in Angular v5.x Warning: Can't resolve all parameters for UsersPermissionsService in C:/SourceControl/Test.Client/src/app/shared/users/users-permissions.service.ts: (?,?). This will become an error in Angular v5.x
我的代码如下:
import { Injectable } from '@angular/core'; @Injectable() export class UsersPermissionsService { public USERS_CREATE_PERMISSION: string = ''; public USERS_UPDATE_PERMISSION: string = ''; public USERS_DELETE_PERMISSION: string = ''; constructor(public UsersCreatePermission: string,public UsersUpdatePermission: string,public UsersDeletePermission: string) { this.USERS_CREATE_PERMISSION = UsersCreatePermission; this.USERS_UPDATE_PERMISSION = UsersUpdatePermission; this.USERS_DELETE_PERMISSION = UsersDeletePermission; } } @Injectable() export class UserModulePermissionsService extends UserPermissionsService { constructor() { super("ClientsCreate","ClientsEdit","ClientsDelete"); } } @Component({ templateUrl: './users-permissions.component.html',providers: [UsersPermissionsService] }) export class UsersPermissionsComponent { constructor(public usersPermissionsService: UsersPermissionsService) { } }
在我的懒惰加载模块中,我有:
providers: [ { provide: UsersPermissionsService,useClass: UserModulePermissionsService } ]
现在,角度5已经出来,我将需要更新,并且消息说这个警告将成为错误.
不明白这里真正的问题是什么.