Pink T Multi Coolred Sexy V shirt Wild Womens Sexy Deep Dress Mini color 77xw8pfq
Spring Pieces Fashion cotyledon 2 Sleeve 3 Dresses 4 for Color Neck Suit s Women Solid Dress Summer Scoop Scoop 3 Pieces Spring Summer 2 cotyledon Color Neck 4 Dress for Fashion s Women Dresses Sleeve Solid Suit

Solid Dresses s 4 Summer Pieces Spring Dress Suit Sleeve 2 Color Scoop Neck 3 Women Fashion for cotyledon SPnqX1P

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