Created
March 13, 2019 02:53
-
-
Save phenomnomnominal/072c0224b68d8acf7cec6c8aaebda242 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Inject, Injectable, InjectionToken, Optional } from '@angular/core'; | |
import { Engine } from './engine'; | |
import { Radio } from './radio'; | |
import { Transmission } from './transmission'; | |
import { Wheel } from './wheel'; | |
const WHEELS = new InjectionToken('Wheels'); | |
@Injectable() | |
class Car { | |
constructor ( | |
public engine: Engine, | |
@Optional() public radio: Radio, | |
@Inject(WHEELS) public wheels: Array<Wheel>, | |
public transmission: Transmission | |
) { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment