Sleeve Skater Low Shoulder Red Women Sexy Off High Jaycargogo Dresses Zw4RxU0
Long Evening Prom Shoulder Black s Off Dresses Women 2018 BP022 BessWedding Mermaid Gowns Long Off s Shoulder Gowns Women Black Prom Dresses BessWedding Evening 2018 Mermaid BP022

s Evening BP022 Off 2018 Dresses BessWedding Black Gowns Prom Women Long Mermaid Shoulder 5qCx4Z1nwf

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