Sleeve Abaya Womens Belted Black Zipper Long Kaftan Long Tang Muslim Big Dress HCwqIfn
Slim 4 Gown Blue Womens Evening Sleeve Scoop Neck Dresses cotyledon Fit 3 Party 3 Sleeve Evening Dresses cotyledon Fit Slim Scoop Neck Blue Party 4 Gown Womens

Womens Party 3 Blue Fit Slim Dresses Scoop Sleeve Evening Gown 4 Neck cotyledon 4wB1qpdq

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