How to use the @delon/theme.AlainThemeModule.forRoot function in @delon/theme

To help you get started, we’ve selected a few @delon/theme examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dotnetcore / OSharp / tests / web / ui / ng-alain8 / src / app / delon.module.ts View on Github external
modal: { size: 'lg' },
  };
}

const GLOBAL_CONFIG_PROVIDES = [
  // TIPS:@delon/abc 有大量的全局配置信息,例如设置所有 `st` 的页码默认为 `20` 行
  { provide: STConfig, useFactory: fnSTConfig },
  { provide: PageHeaderConfig, useFactory: fnPageHeaderConfig },
  { provide: DelonAuthConfig, useFactory: fnDelonAuthConfig },
  { provide: DelonACLConfig, useFactory: fnDelonACLConfig },
];

// #endregion

@NgModule({
  imports: [AlainThemeModule.forRoot(), DelonACLModule.forRoot(), ...MOCK_MODULES],
})
export class DelonModule {
  constructor(@Optional() @SkipSelf() parentModule: DelonModule) {
    throwIfAlreadyLoaded(parentModule, 'DelonModule');
  }

  static forRoot(): ModuleWithProviders {
    return {
      ngModule: DelonModule,
      providers: [...REUSETAB_PROVIDES, ...GLOBAL_CONFIG_PROVIDES],
    };
  }
}
github dotnetcore / OSharp / samples / web / ui-clients / ng-alain8 / src / app / delon.module.ts View on Github external
modal: { size: 'lg' },
  };
}

const GLOBAL_CONFIG_PROVIDES = [
  // TIPS:@delon/abc 有大量的全局配置信息,例如设置所有 `st` 的页码默认为 `20` 行
  { provide: STConfig, useFactory: fnSTConfig },
  { provide: PageHeaderConfig, useFactory: fnPageHeaderConfig },
  { provide: DelonAuthConfig, useFactory: fnDelonAuthConfig },
  { provide: DelonACLConfig, useFactory: fnDelonACLConfig },
];

// #endregion

@NgModule({
  imports: [AlainThemeModule.forRoot(), DelonACLModule.forRoot(), ...MOCK_MODULES],
})
export class DelonModule {
  constructor(@Optional() @SkipSelf() parentModule: DelonModule) {
    throwIfAlreadyLoaded(parentModule, 'DelonModule');
  }

  static forRoot(): ModuleWithProviders {
    return {
      ngModule: DelonModule,
      providers: [...REUSETAB_PROVIDES, ...GLOBAL_CONFIG_PROVIDES],
    };
  }
}
github ng-alain / delon / src / app / delon.module.ts View on Github external
return Object.assign(new STConfig(), {
    ps: 3,
  });
}

export function fnLodopConfig(): LodopConfig {
  return Object.assign(new LodopConfig(), {
    license: `A59B099A586B3851E0F0D7FDBF37B603`,
    licenseA: `C94CEE276DB2187AE6B65D56B3FC2848`,
  });
}

// #endregion

@NgModule({
  imports: [AlainThemeModule.forRoot(), DelonFormModule.forRoot(), DelonACLModule.forRoot(), DelonMockModule.forRoot({ data: MOCKDATA })],
})
export class DelonModule {
  constructor(
    @Optional()
    @SkipSelf()
    parentModule: DelonModule,
  ) {
    throwIfAlreadyLoaded(parentModule, 'DelonModule');
  }

  static forRoot(): ModuleWithProviders {
    return {
      ngModule: DelonModule,
      providers: [...REUSETAB_PROVIDES, { provide: STConfig, useFactory: fnSTConfig }, { provide: LodopConfig, useFactory: fnLodopConfig }],
    };
  }
github ng-alain / delon / site / app / delon.module.ts View on Github external
import { AdLodopConfig, DelonABCModule } from '@delon/abc';

export function adLodopConfig(): AdLodopConfig {
    return Object.assign(new AdLodopConfig(), {
        license: `A59B099A586B3851E0F0D7FDBF37B603`,
        licenseA: `C94CEE276DB2187AE6B65D56B3FC2848`
    });
}

// endregion

@NgModule({
    imports: [
        NgZorroAntdModule.forRoot(),
        // theme
        AlainThemeModule.forRoot(),
        // abc
        DelonABCModule.forRoot(),
        // form
        DelonFormModule.forRoot(),
        DelonUtilModule.forRoot()
    ]
})
export class DelonModule {
  constructor( @Optional() @SkipSelf() parentModule: DelonModule) {
    throwIfAlreadyLoaded(parentModule, 'DelonModule');
  }

  static forRoot(): ModuleWithProviders {
      return {
          ngModule: DelonModule,
          providers: [
github ng-alain / delon / packages / cache / src / cache.spec.ts View on Github external
function genModule(defaultCog?: DelonCacheConfig) {
    const providers: any[] = [];
    if (defaultCog) {
      providers.push({ provide: DelonCacheConfig, useValue: defaultCog });
    }
    injector = TestBed.configureTestingModule({
      imports: [HttpClientTestingModule, AlainThemeModule.forRoot(), DelonCacheModule],
      providers,
    });

    srv = injector.get(CacheService);
  }
github ng-alain / delon / packages / form / spec / base.spec.ts View on Github external
export function builder(options?: { detectChanges?: boolean; template?: string; ingoreAntd?: boolean; imports?: any[] }) {
  options = { detectChanges: true, ...options };
  TestBed.configureTestingModule({
    imports: [NoopAnimationsModule, AlainThemeModule.forRoot(), DelonFormModule.forRoot()].concat(options.imports || []),
    declarations: [TestFormComponent],
  });
  if (options.template) {
    TestBed.overrideTemplate(TestFormComponent, options.template);
  }
  fixture = TestBed.createComponent(TestFormComponent);
  dl = fixture.debugElement;
  context = fixture.componentInstance;
  spyOn(context, 'formChange');
  spyOn(context, 'formSubmit');
  spyOn(context, 'formReset');
  spyOn(context, 'formError');
  if (options.detectChanges !== false) {
    fixture.detectChanges();
  }
  const page = new SFPage(context.comp);
github ng-alain / delon / packages / form / spec / base.spec.ts View on Github external
configureTestSuite(() => {
    TestBed.configureTestingModule({
      imports: [NoopAnimationsModule, AlainThemeModule.forRoot(), DelonFormModule.forRoot(), HttpClientTestingModule],
      declarations: [TestFormComponent],
    });
  });
}
github dotnetcore / Util / sample / Util.Samples.Angular.AntDesign / Typings / app / app.module.ts View on Github external
//启动服务工厂
export function startupServiceFactory( startupService: StartupService ) {
    return () => startupService.load();
}

/**
 * 应用根模块
 */
@NgModule( {
    declarations: [AppComponent],
    imports: [
        BrowserModule,
        BrowserAnimationsModule,
        HttpClientModule,
        AlainThemeModule.forRoot(),
        FrameworkModule,
        HomeModule,
        AppRoutingModule
    ],
    providers: [
        StartupService,
        {
            provide: APP_INITIALIZER,
            useFactory: startupServiceFactory,
            deps: [StartupService],
            multi: true,
        },
        { provide: NZ_ICONS, useValue: icons },
        { provide: UploadService, useClass: TestUploadService }
    ],
    bootstrap: [AppComponent],
github DesignHhuang / flowchart-angular6 / src / app / delon.module.ts View on Github external
export function fnSTConfig(): STConfig {
    return {
        ...new STConfig(),
        ...({
            modal: { size: 'lg' },
        } as STConfig),
    };
}

const GLOBAL_CONFIG_PROVIDES = [
    { provide: STConfig, useFactory: fnSTConfig },
    { provide: PageHeaderConfig, useFactory: fnPageHeaderConfig },
];

@NgModule({
    imports: [AlainThemeModule.forRoot(), ...MOCK_MODULES],
})
export class DelonModule {
    constructor(@Optional() @SkipSelf() parentModule: DelonModule) {
        throwIfAlreadyLoaded(parentModule, 'DelonModule');
    }

    static forRoot(): ModuleWithProviders {
        return {
            ngModule: DelonModule,
            providers: [...GLOBAL_CONFIG_PROVIDES],
        };
    }
}