Mermaid For Prom Evening Coffe s Women Sequined Solovedress Formal Wedding Dress Gown qTpEgcx0
Zip Round Strap Size Bags 7 Poly Shoulder Yoga Yoga Music mm x Closure Cover Printed inch Design 28 Mat Canvas 7 Mat Canvas Zip Strap inch Size Closure Music Cover Shoulder Bags Printed Poly x Yoga 28 mm Design Yoga Round

inch Mat Design Printed Closure Size Music Poly Bags Canvas 28 7 Strap Cover Zip Round Yoga mm Shoulder Yoga x xq7wtg4tR

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