MCPcopy
hub / github.com/angular/angular / ɵɵdefineNgModule

Function ɵɵdefineNgModule

packages/core/src/render3/definition.ts:394–432  ·  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

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…