U Colorful Collar Stripes Dresses As1 One Outfit 2 Pieces Women Step CpxdBEwqd
Side Womens Batwing Splice Slit Fit Cromoncent Sleeve Dress Blue Maxi Ballgown Royal Loose Slit Maxi Batwing Royal Cromoncent Dress Womens Sleeve Blue Side Fit Splice Ballgown Loose

Fit Cromoncent Slit Royal Sleeve Womens Dress Loose Side Maxi Batwing Splice Blue Ballgown 8Hg4q8r

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