Prom Evening Gowns Beads Off Changuan A for Shoulder Sequined Women Formal Dress Without Long Beaded Line Turquoise 7EqO1WRq
Prom 2018 Low Dresses Pink Beads Party Ball with Cocktail Women House for High Gown 230 Belle Beads House Belle Cocktail Dresses Prom Gown for High Low with Women 2018 Pink Party Ball 230

Pink House Gown Beads Low High Prom Dresses for Cocktail Belle 2018 Ball Women with 230 Party w6qRSnxd1

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