Red Bodycon Mini Club Sleeve Domple s Strapless Women Bell Sexy Dress Bowknot Wine xaA7OSx
Chiffon Cutout Evening Embellished Dress Gown 1 Formal Royal Decode Blue 8 2 Decode Gown Cutout 8 Embellished Royal Evening Formal Blue 2 Dress 1 Chiffon

Embellished 1 Cutout 8 Formal Chiffon Dress Gown Royal Evening 2 Decode Blue x7XgqfqZ

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