your recipe card header background

    Angular Module Skipself Constructor

    0

    0

    Jose Romero

    Angular TypeScript Recipes

    The code creates a new ModuleName object and sets its parentModule property to be the parentModule that was passed in as an argument. If the parentModule property is undefined, the code uses the AppModule as the parent module.

    Library: angular

    Shortcut: angular.constructor.skip.self

    constructor( @Optional() @SkipSelf() parentModule: ModuleName {
      if (parentModule) {
        const msg = `ModuleName has already been loaded. 
          Import ModuleName once, only, in the root AppModule.`;
        throw new Error(msg);
      }
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.