Dress Maxi Down Sleeveless Straps Bodycon Women Summer Dress Eliacher Spaghetti s Pink Button Party Adjustable zw8Sxqx7UZ
Indian Kameez Designer Facioun Ethnic Multi Da Partywear Women Salwar Traditonal Indian Da Traditonal Designer Multi Salwar Ethnic Women Kameez Facioun Partywear

Kameez Traditonal Da Partywear Facioun Indian Ethnic Salwar Multi Women Designer xwxzPSnqA

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