Dress Sheath s Fire 2 Princess Women Klein Sleeveless Multi Scuba Calvin Seamed wa8f6
Women Dress Coolred Painting and 1 Short Summer Skirt Sleeve Printed Summer Maxi Midi Loose Pullover Digital Midi Coolred Midi Short Printed Maxi Skirt Summer Women Summer Sleeve Midi Digital Pullover 1 Painting Dress and Loose

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