Weeding 2017 Party White Women Dress Evening Crystell Dress Dress xq0Hata7
Domple 3 4 Off Dress Sexy Ruffles Shoulder Mini Bodycon Black Sleeve Women Domple Sexy Off Black Shoulder Sleeve 3 Women Dress Mini Ruffles Bodycon 4

3 Dress Shoulder Bodycon Ruffles 4 Off Women Sleeve Sexy Black Domple Mini I4xRaqBv

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