Injectable

Injectable decorator

What it does

A marker metadata that marks a class as available to Injector for creation.

How to use

@Injectable() class Car {}

Description

For more details, see the Dependency Injection Guide.

Example

@Injectable()
class UsefulService {
}

@Injectable()
class NeedsService {
  constructor(public service: UsefulService) {}
}

const injector = Re