Outfit s Women Bandage Strapless Skirts Two Domple Pieces Set Club Black Sexy z15qZBw
Step 4th As Stretchy Beachwear Patriotic Sleeveless One Cozy Star Summer Picture July Fit Sexy Mid Silm Dress Coolred Women Star Cozy Mid Summer Silm Patriotic Stretchy 4th Women July One Dress Sexy Coolred Step Sleeveless Picture As Fit Beachwear

Coolred Star Picture Stretchy Cozy Summer Sexy Patriotic Beachwear Fit Dress 4th As One Silm Sleeveless Step Mid Women July rpqIUr

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