Women Side Printing Cheongsam Mandarin Pattern9 Splicing Coolred Collar Slit pBwv6xB1
fox wedge high cute Butterfly Womens pone aztec Color10 11 floral heel Zenzzle on colorful dogs pattern size shoes prin pumps 5 pattern pone size prin Butterfly Color10 dogs wedge cute 5 pumps high heel colorful fox aztec shoes floral 11 Zenzzle Womens on

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