Sheath Appliqued Mermaid Ruffled Sexy Evening Dress White Red Prom Fitted TBGirl qxABFETq
dozenla Maxi Maxi Apricot Dresses Women Crystal Dresses Maxi s Dress Formal Cocktail Vintage Apricot Maxi Cocktail dozenla Women Formal Dress Vintage Dresses s Dresses Maxi Crystal Maxi

Crystal Dress Vintage Maxi Apricot Dresses Cocktail Women Maxi s Maxi Dresses Formal dozenla qIAOff

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