Shape Shell Rosary Damara Gold Beads Dress Belt Stylish Women OaEE4Sxqw
Pink with House Cocktail Beads Prom 230 Belle Party for 2018 Gown Low Ball Dresses High Women Party Beads with Low Belle Pink High Prom for Women Dresses House Ball Cocktail 230 Gown 2018

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