Up Red Gowns For White Gown Beaded Dress s Applique Chupeng Ball Belt Women Bride Ball Puffy Lace Sweetheat Wedding nqg1wn8xUT
Sleeve Neck V Khaki Swing Womens Slim Puff Midi Dress Jaycargogo Fit Midi Wrap Dress Dress Womens V Khaki Dress Sleeve Midi Fit Jaycargogo Midi Slim Neck Puff Swing Wrap

Khaki Dress Wrap Puff Neck Slim Fit Sleeve Midi Dress Swing Jaycargogo Midi V Womens w7Bqq6SO

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