Green Bodycon Dress ainr Sexy Collar Sleeveless High Womens Cocktail Fashion Party Midi YqvqBAPF
Womens prin dogs aztec pone size 11 Butterfly pumps fox heel floral on colorful 5 pattern shoes high Zenzzle cute wedge Color10 fox cute 11 Zenzzle colorful shoes pattern dogs 5 pumps pone Color10 wedge size floral prin Butterfly Womens on heel aztec high

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