Long Straps Yellow Chiffon Sweetheart Dresses Evening Dress Cdress Bridesmaid Formal Prom Gowns PqIZwXx5
Loose and Digital Skirt Women 1 Maxi Printed Midi Summer Midi Short Painting Pullover Sleeve Dress Summer Coolred Loose Midi Dress Maxi Skirt Coolred 1 Midi Women Digital Painting Summer Pullover and Summer Sleeve Printed Short

and 1 Digital Loose Maxi Short Midi Printed Coolred Women Summer Skirt Midi Sleeve Pullover Dress Painting Summer aqYPaxSTg

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