Dress 2018 Prom Pockets Swing Sleeve Party Long Dress Evening Dot Chanyuhui Pockets Printing Stripe Gray Women Womens zxxwq6gp
Size Assymetry Dress Comfy Plus Color Mulit Club Printing s Shirt Women Black Dress Color s Plus Printing Women Assymetry Comfy Club Black Mulit Size Shirt

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