Mermaid 2018 BessWedding Open Prom Red Back Dresses BP035 Evening Long Sequins Women s Party Gowns EYffwqF4
Dress Irregual Cruiize Ruffle Slim Womens Red Shoulder Hem Club Off Solid Fit Ruffle Slim Irregual Dress Solid Fit Womens Off Cruiize Red Club Hem Shoulder

Solid Shoulder Ruffle Cruiize Red Womens Slim Irregual Hem Dress Club Off Fit wUazqZp

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