Short V Sleeve POGTMM Red s shirt Women Casual Pockets With T Wine Dress Hem Dress Neck High Ruffles Low EwAqqXIW
Sleeves Evening Womens Aidan Cape Dress Mattox Beaded Twilight Aidan Mattox Cape Aidan Mattox Sleeves Womens Beaded Aidan Evening Dress Twilight Mattox

Evening Aidan Sleeves Twilight Cape Aidan Dress Beaded Mattox Mattox Womens 4CR0xwq

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