Casual Line Summer Dress Sleeveless Women 121 Loose A Floral Beach Evening Boho Mini Printed Party Sumaida s 4vw18
size dogs Butterfly cute pumps Color10 heel shoes prin Zenzzle floral colorful fox on 5 wedge Womens aztec high 11 pattern pone on size fox Zenzzle shoes heel Color10 pone Butterfly floral high wedge 11 pumps cute aztec colorful pattern dogs Womens prin 5

cute aztec prin wedge on shoes pattern Color10 colorful pone dogs Zenzzle Butterfly pumps floral high heel fox 5 Womens 11 size BqwWZn1OY

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