Pumps Nude with Dress Women Heels Platforms s High Pumps MERUMOTE platform gold Party Wedding with T0v7xwP
Neck Cromoncent Falbala Pendulum Fit Slim Big Turtle Low Dresses High Tunic Womens Mock Blue Blue Pendulum Dresses Falbala Mock Cromoncent Fit High Low Slim Neck Tunic Big Womens Turtle

Womens Falbala Slim Low Blue Turtle Mock Pendulum Fit Tunic Neck High Dresses Big Cromoncent qd6pAx6

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