V Big Party Yellow Neck Floral Women Dresses Pendulum Waist Coolred Chiffon Printed Empire 4xqz5FFw
House Cocktail Women Low Belle Gown Dresses 230 with Party Ball for High 2018 Beads Pink Prom Ball Women 2018 Cocktail with Beads Gown Prom Party Low 230 High Dresses House Pink for Belle

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