Aqua Wear Indian Traditional Party Facioun Green Wedding Da Women Sari Designer Sarees 4fwUzq
Half H Wedding S Mermaid Sleeve Women Sweetheart Dress Bridal s Gown D Long Lace White s Sweetheart H Women White Lace Sleeve D Bridal Long Dress Half S Wedding Gown Mermaid

H Half White Long Gown Dress Wedding Women Sweetheart s D Bridal Sleeve Lace Mermaid S rZqYUr

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