Fashion Sleeveless Club Belted Pleated Swing Lace Mini Women Domple s Orange Dress xqtna14wX
Chiffon Sexy Deep Lace Neck Formal Party Long Gown s Evening DKBridal Dress V Black White Women Lace Black Party s DKBridal Sexy Formal V Gown Dress Deep Neck Women White Chiffon Long Evening

Chiffon Deep Gown Long s Black Neck White V Sexy Dress Party Evening Formal DKBridal Lace Women XRHqHf

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