Red Dress Halter Print Neck Retro Backless Floral Jaycargogo Women s XL Sexy RwnxzxvTUq
up Ball Black V Wedding Dress Prom Evening s Lace Gown Women Bess Neck Tulle Bridal Bess Dress Lace Bridal Prom Gown Wedding up Tulle Black s Ball Evening Neck V Women

Lace Wedding Evening Women Tulle Gown Bess s Prom Dress Black Ball Bridal V Neck up wq70a

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