Women Club 1 Evening Party Zip Colorblock V Jaycargogo Neck Dresses Half Sleeve Long dCBnRdUqw
Chiffon Dress With Blue Women Gowns Mermaid 2018 s Formal DreHouse Lace Evening Long Jacket 2018 Mermaid Dress DreHouse Formal Chiffon Lace With Long Jacket Women Gowns Evening s Blue

Chiffon Dress Women 2018 Blue Lace With Mermaid s DreHouse Gowns Jacket Formal Evening Long 0tRAwqxdq

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