0
1
llucycodes42
The code creates a constructor that takes one argument, @Optional(). If the argument is not null, then the parentModule property is set to the argument. If the argument is null, then the parentModule property is set to the empty string. The constructor then prints a message telling the user that ModuleName has already been loaded.
Library: angular
Shortcut: a_ctor_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);
}
}