Cocktail Straps High Dress Neck Tribal Coolred Women Backless Cross Black xwpaRZaB0q
Dresses for s Weddings Bridesmaid ANTS Women Chiffon Long Strapless Maroon Long Women Maroon Weddings Strapless s for Chiffon Bridesmaid ANTS Dresses

Long ANTS for Dresses Maroon Weddings Chiffon Bridesmaid s Women Strapless tUtnqwTpv

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