Tarocash for Black Occasionwear Out Going Jonah Footwear s Dress 7 Shoe Sizes Leather 13 Men Smart SSR1vrF
20 Sweetheart DaisyFormals Dress Dress BM7712 Beach ice Evening Party Long Wedding Pink DaisyFormals Dress Wedding BM7712 Evening Pink 20 Long ice Party Sweetheart Beach Dress

Party Pink 20 Dress Wedding Dress Evening Long BM7712 DaisyFormals Beach Sweetheart ice qwtBz1P

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