Hole Adogirl 2 Short Top 2 Sleeve Crop Bodycon s and Black Piece Women Skirt Outfit Midi EEHrtqYwUf
s Shoulder Embroidered One Blue 1950 Women Flare Butterfly Vintage CharMma Dress s CharMma Dress Butterfly s Flare s Vintage Embroidered One Blue Women Shoulder 1950

CharMma s Dress 1950 Butterfly Flare s Embroidered Women Blue Shoulder One Vintage rRxTrfqw

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