of Women Dye Columbia Dress State Dotty Mind Black s URxqwT7
Dress Long V A Stretchy Velvet Swing Women Sexy 1 Sleeve neck Line Jaycargogo s Swing Sleeve Dress 1 Velvet Women Sexy Line neck s A Long Stretchy V Jaycargogo

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