Shoulder Gold One Gown Dress Party Evening Anlin Long Bridesmaid Prom Chiffon Beaded AN91 S5vq7qnwR
Dresses A Prom Women Green Golden Line Chupeng s Evening Long Beaded Formal Green Formal Beaded Women Dresses Chupeng A s Golden Evening Long Line Prom

Line A Long Formal Prom Beaded Green Women Golden Dresses s Evening Chupeng aSFqXc

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