Color Career Coolred Women Evening Plus V Neck Pattern1 Party Dress Size Ruched Pure xn8Fw0Oq81
Champagne Vintage Gowns Dresses XingMeng Homecoming Prom Cocktail A Short line Pleated Short Gowns Prom line A Homecoming Champagne Vintage Dresses Cocktail XingMeng Pleated

Cocktail Short Champagne Pleated Homecoming Prom Gowns line Vintage XingMeng A Dresses 0vdq44w

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