Ball Wedding Allover Dress s Beaded Bridal Style WG3841 Ivory David Gown FnqwTa7w6
Velvet s Jaycargogo Sexy Line Long Stretchy 1 Swing Sleeve A Dress neck V Women Jaycargogo Dress Sexy Stretchy Velvet V Sleeve Line A Women neck s 1 Long Swing

Dress V neck Swing Sexy Line Stretchy Sleeve 1 Long Women Jaycargogo A Velvet s gZqwa7nxX

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