Sweetheart Dress Ivory Beaded Wedding 2018 Mermaid Dresses Mermaid Gowns Long Bride Tulle Dimei Wedding qtX6gxO1gw
Party Sexy Night V Jaycargogo Dress Choker Embroidery Neck Sleeveless Mini Club Women 2 Mini Night Sexy Neck Women Dress Club Sleeveless Party Embroidery Choker Jaycargogo 2 V

Dress Sleeveless Choker Mini Embroidery Night Party Jaycargogo Women Club 2 Sexy V Neck qPntvxIAw6

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