Party Indian Teal For Wedding Women Sarees Saree Facioun Traditional Designer Wear 54 Da n5Ptwq01xX
Dress Size Color Club s Plus Shirt Assymetry Printing Comfy Women Black Mulit Size Shirt Black Mulit Dress Women Plus Comfy Printing Assymetry s Club Color

Assymetry Dress Black Plus s Shirt Comfy Women Mulit Printing Color Size Club PvPUIwqxp

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