Deep s Business Dress Green Neck Two Sleeve Midi Long Colors Bodycon4U Work V Women qIRp4ww51
Shoulder Word Dress Flounced Sexy Coolred Evening Black Color One Party Pure Women Word One Sexy Pure Dress Evening Coolred Flounced Color Black Women Party Shoulder

One Evening Sexy Pure Black Coolred Flounced Dress Color Party Women Word Shoulder Z7XznxqBTW

A constructor parameter decorator that marks a dependency as optional.

See also

Description

The DI framework provides null if the dependency is not found. For example, the following code allows the possibility of a null result:

class Engine {} @ Injectable() class Car { constructor(@ Optional() public engine: Engine) {} } const injector = ReflectiveInjector.resolveAndCreate([Car]); expect(injector.get(Car).engine).toBeNull();
      
      class Engine {}

@Injectable()
class Car {
  constructor(@Optional() public engine: Engine) {}
}

const injector = ReflectiveInjector.resolveAndCreate([Car]);
expect(injector.get(Car).engine).toBeNull();
    

Options