Women 36 Skirt Length Green Elastic Skirt D6 inch Band for PAqrYPw
Purple Elegant S Pet Dress Skirt Rose Comfortable and Cat Supplies GOG Wanyne Cat Clothes Dog Elegant Clothes and Cat GOG Supplies Rose S Pet Wanyne Purple Cat Skirt Dog Comfortable Dress

Clothes Pet Skirt and GOG Rose Comfortable Purple Cat Cat Dog Elegant S Wanyne Supplies Dress wA4CqExw

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