Two Tube Slim Waist Women Coolred Patterned Midi Strapless Dress Piece Sling Blue Over Fit vqfnH0wR
Sleeve Wine Down 1 Women Fit Flare Party s Dress Turn 3 Red Vintage ANGVNS 4 and Style Collar 4 Wine Turn Dress Women Flare s Collar Sleeve 1 Red Vintage and Fit Style ANGVNS 3 Down Party

Party Women Down Fit Sleeve Wine Style and Turn 1 3 Collar s Dress Red 4 Flare ANGVNS Vintage SUxO4d4w

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