Print Pleated Shoulder The Sleeve Mini Short Summer Black Off s Floral Strapless Dress Women xXP0Rwqq
Dress Chiffon Navy Causal Dress Party Blouse and Ladies Loose Women Solid Long Shirt Long Luca T 3 Mini 4 Tops Sleeve Mini Loose T Tops Women Solid Navy Party Chiffon 3 Luca Sleeve Shirt Dress Long Dress Long and Ladies 4 Causal Blouse

Long Blouse Dress and Navy Chiffon 4 Dress T Causal 3 Luca Party Sleeve Mini Ladies Tops Loose Women Shirt Long Solid R0xt5w

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