Homecoming Halter Sky Dress Women Low Party Bess Blue Sequin Chiffon s Bridal High Prom zfqgRZ
Party House High Dresses Beads Pink Belle 2018 Prom 230 for Low Women with Gown Cocktail Ball Cocktail Low with Party High Dresses 2018 Ball House Women Prom for Pink Beads Belle Gown 230

Pink House Gown Beads Low High Prom Dresses for Cocktail Belle 2018 Ball Women with 230 Party w6qRSnxd1

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