Tango Latin Performance Glitter Costume Red Tassel Party Ladies Zhuhaitf Ballroom Dance Dress Cocktail 4BxIn
With Jacket Dress Chiffon Mermaid Evening Women DreHouse Long Lace Formal s 2018 Gowns Blue With 2018 Lace Gowns DreHouse Formal Long Women Evening Blue Mermaid Dress Chiffon Jacket s

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