Womens Bodycon Dresses Through See Sequin Patchwork Jaycargogo Sexy 1 Mesh Strapless 8xzad86qw
s Women Traditional Jaycargogo Mini Yellow African Bodycon Print Dashiki Sleeve Dress Short African Dress Yellow Dashiki Sleeve Bodycon Traditional Mini s Print Women Jaycargogo Short

Mini Sleeve Dashiki Jaycargogo Dress African Yellow Print Short Women Traditional Bodycon s OOq8X7gnz

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