@Injectable类修饰器的tslint规则,而不是@Inject参数修饰器

问题描述

我想知道是否有任何规则告诉您是否在具有依赖项的构造函数中使用@Inject,而不是使用@Injectable()装饰器。

例如,代替此:

@Injectable({
  providedIn: 'root'
})
export class AService {

  constructor(@Inject(APP_SERVICE_STORAGE) private readonly storage: AStorageService) { }
}

应该是:

@Injectable()
export class AService {

  constructor(private readonly storage: AStorageService) { }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)