s Maxi Dresses Formal Bridesmaid Evening Chiffon Dress Prom Women Keyhole Aqua Gowns Cdress Long x0SwFqXT5
Gown Bridesmaid Dress Women ASBridal The Chiffon Evening Mother s Bride Orange of Long Orange ASBridal Dress s Bridesmaid Mother Gown Evening Chiffon Women Bride The of Long

Gown of Chiffon Orange The ASBridal Evening Bride Mother Women Dress s Long Bridesmaid wCPAFHq

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