Short Sexy Shoulder Blue Dress JeanewPole1 Mini Shirt Button Plain Plus Womens The Up Sleeve Dress Size T Off vOOqTfHxw4
Hit Dress Crewneck Coolred Waist Colorful Sleeveless Women Big Swing Elegant Flowy Leisure Splice Baggy Mid As1 Color Maxi Baggy Colorful Coolred Splice Elegant Women Swing Leisure Dress Hit Big As1 Crewneck Sleeveless Color Waist Maxi Flowy Mid

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