p.location-badge.
exported from angular2/di
defined in angular2/src/di/metadata.ts (line 17)
:markdown
A parameter metadata that marks a dependency as optional. Injector
provides `null` if
the dependency is not found.
```
class AComponent {
constructor(@Optional() aService:MyService) {
this.aService = aService;
}
}
```
.l-main-section
h2 Annotations
.l-sub-section
h3.annotation CONST
pre.prettyprint
code.
@CONST()
.l-main-section
h2 Members
.l-sub-section
h3 toString
pre.prettyprint
code.
toString()
:markdown