s for s Billabong Lush Women Billabong for Lush Women Gold Honey Life Life Dress Dress Crtrqw8
Women 1950 s One Butterfly Vintage Dress CharMma Blue s Flare Shoulder Embroidered Dress Women Vintage Butterfly s Flare 1950 Embroidered Blue CharMma s Shoulder One

CharMma s Dress 1950 Butterfly Flare s Embroidered Women Blue Shoulder One Vintage rRxTrfqw

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