Dress with Mini s ARJOSA Club Bodycon Spaghetti Casual White Strap Women Sleeveless Party 8zqwp8
Striped Summer Short Sleeve Shirt Fit Neck Basic Crew Slim Dress T Cromoncent Women Black Crew Shirt Cromoncent Short Basic Dress Women Black Fit Neck Summer Sleeve T Slim Striped

Striped Fit Sleeve Cromoncent Short Women Crew Summer Black T Dress Basic Shirt Slim Neck RtBqUq

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