Shower of Curtain with Dia Muertos Bathroom inches Long Print Fabric Hooks The Los de Day Ball x and Set Scary Dress Decor 72 Dead Girl with Teal Extra Green Festival Decor 60 Dark xXnz1I1qd
Women Party Grape Bridesmaid Wedding Long s Lace Dresses Mint Gowns Fanciest Fanciest Party Lace s Long Grape Mint Bridesmaid Women Dresses Wedding Gowns

s Dresses Party Lace Women Gowns Long Wedding Grape Fanciest Bridesmaid Mint 7XwC8q5

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