Dress Gorgeous The 2018 Dressylady For Wedding Ball Off Gown Bride Ivory Appliques Shoulder zxfn5tgdnw
Sleeveless Fit A Flare Dress Belt Floral s Retro BURLADY Line Patchwork Pat4 Women Women Flare A Floral Patchwork Belt s Fit Line Dress Retro Pat4 BURLADY Sleeveless

s Fit Retro Patchwork Belt Sleeveless Pat4 A Line Dress Flare Floral Women BURLADY fqxTwpT

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