MCPcopy Create free account
hub / github.com/angular/angular / ɵɵdefineNgModule

Function ɵɵdefineNgModule

packages/core/src/render3/definition.ts:388–426  ·  view source on GitHub ↗
(def: {
  /** Token representing the module. Used by DI. */
  type: T;

  /** List of components to bootstrap. */
  bootstrap?: Type<any>[] | (() => Type<any>[]);

  /** List of components, directives, and pipes declared by this module. */
  declarations?: Type<any>[] | (() => Type<any>[]);

  /** List of modules or `ModuleWithProviders` imported by this module. */
  imports?: Type<any>[] | (() => Type<any>[]);

  /**
   * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this
   * module.
   */
  exports?: Type<any>[] | (() => Type<any>[]);

  /** The set of schemas that declare elements to be allowed in the NgModule. */
  schemas?: SchemaMetadata[] | null;

  /** Unique ID for the module that is used with `getModuleFactory`. */
  id?: string | null;
})

Source from the content-addressed store, hash-verified

386 * @codeGenApi
387 */
388export function ɵɵdefineNgModule<T>(def: {
389 /** Token representing the module. Used by DI. */
390 type: T;
391
392 /** List of components to bootstrap. */
393 bootstrap?: Type<any>[] | (() => Type<any>[]);
394
395 /** List of components, directives, and pipes declared by this module. */
396 declarations?: Type<any>[] | (() => Type<any>[]);
397
398 /** List of modules or `ModuleWithProviders` imported by this module. */
399 imports?: Type<any>[] | (() => Type<any>[]);
400
401 /**
402 * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this
403 * module.
404 */
405 exports?: Type<any>[] | (() => Type<any>[]);
406
407 /** The set of schemas that declare elements to be allowed in the NgModule. */
408 schemas?: SchemaMetadata[] | null;
409
410 /** Unique ID for the module that is used with `getModuleFactory`. */
411 id?: string | null;
412}): NgModuleDef<T> {
413 return noSideEffects(() => {
414 const res: NgModuleDef<T> = {
415 type: def.type,
416 bootstrap: def.bootstrap || EMPTY_ARRAY,
417 declarations: def.declarations || EMPTY_ARRAY,
418 imports: def.imports || EMPTY_ARRAY,
419 exports: def.exports || EMPTY_ARRAY,
420 transitiveCompileScopes: null,
421 schemas: def.schemas || null,
422 id: def.id || null,
423 };
424 return res;
425 });
426}
427
428/**
429 * Converts binding objects from the `DirectiveDefinition` into more efficient

Callers 2

SubModuleClass · 0.90
MainModuleClass · 0.90

Calls 1

noSideEffectsFunction · 0.90

Tested by

no test coverage detected