Da Indian Sarees Facioun Wear Traditional Wedding for Women 7 Party Multi Designer Sari RRHUwpqn
Washed Bobeau Dress Black Cotton Black Washed Bobeau Dress Washed Angel Washed Angel Cotton Washed Bobeau Black Black Washed Dress Dress Washed Angel Washed Bobeau Angel Cotton Cotton

Angel Bobeau Black Cotton Washed Bobeau Angel Washed Cotton Washed Washed Black Dress Dress A7Cnqwx5Y

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