Women Embroidered Half V Short Dress Pattern1 Baggy Coolred Sleeve Neck Ethnic Lounge d8qtwxt1R
Short V Chiffon Dresses Beaded Prom Party Cocktail Neck Dresses BD093 BessDress Mint Short Neck V Beaded Prom BD093 Dresses Cocktail Mint BessDress Chiffon Dresses Party

Prom Dresses Dresses Beaded Cocktail Party Neck BD093 Mint Chiffon V Short BessDress t6q4wU11

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