也许你正在寻找的是UseClass、UseFactory、UseValue和UseExisting https://offering.solutions/blog/articles/2018/08/17/using-useclass-usefactory-usevalue-useexisting-with-treeshakeable-providers-in-angular/