rd-outer-component 0.0.68 → 0.0.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1956,18 +1956,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1956
1956
  }]
1957
1957
  }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.EnvironmentInjector }]; } });
1958
1958
 
1959
- // notification.module.ts
1959
+ // notification.module.ts (在 NPM 包中)
1960
1960
  class RdNotificationModule {
1961
1961
  constructor(parentModule) {
1962
1962
  if (parentModule) {
1963
1963
  throw new Error('RdNotificationModule is already loaded. Import it in the AppModule only');
1964
1964
  }
1965
1965
  }
1966
- // 可选:提供配置方法
1967
- static forRoot() {
1966
+ // 修复:使用正确的类型和静态方法
1967
+ static forRoot(config) {
1968
1968
  return {
1969
1969
  ngModule: RdNotificationModule,
1970
- providers: [RdNotificationService],
1970
+ providers: [
1971
+ RdNotificationService,
1972
+ // 如果有配置,可以在这里提供
1973
+ config ? { provide: 'RD_NOTIFICATION_CONFIG', useValue: config } : [],
1974
+ ],
1971
1975
  };
1972
1976
  }
1973
1977
  }
@@ -1980,9 +1984,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1980
1984
  imports: [CommonModule, NzNotificationModule],
1981
1985
  declarations: [RdNotificationComponent],
1982
1986
  exports: [RdNotificationComponent],
1983
- providers: [
1984
- // Service 已经在 @Injectable 中提供了,这里不需要重复提供
1985
- ],
1986
1987
  }]
1987
1988
  }], ctorParameters: function () { return [{ type: RdNotificationModule, decorators: [{
1988
1989
  type: Optional