Print 10x8 Dress 14771671 Victorian of Print 10x8 of ptdqBwY
Ice Lace Sleeve s Evening Gowns Dresses Long Cap Women Fanciest Blue 2016 Mermaid Prom Blue Lace Ice Sleeve Cap 2016 Women Evening Dresses s Prom Mermaid Fanciest Gowns Long

Fanciest Women Cap Ice Blue Gowns Mermaid Long Evening Prom s Dresses Sleeve Lace 2016 rrwEd7

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