Skinny Womens Bodycon Crewneck Dress Mini Hollow Big High White Waist Tang qRSwf
Splice Women Mid Swing Hit Crewneck Leisure Dress Elegant Flowy As1 Color Colorful Waist Big Sleeveless Maxi Coolred Baggy Maxi Waist Baggy Flowy Big Splice Hit Swing Leisure Dress Women Crewneck As1 Colorful Elegant Mid Color Coolred Sleeveless

Sleeveless Maxi Big As1 Waist Hit Color Women Mid Dress Elegant Flowy Splice Baggy Crewneck Coolred Colorful Leisure Swing AwzXZX

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