Last active
December 12, 2021 12:19
-
-
Save vahidvdn/d776bbb029085b0c0eb0668226607bac to your computer and use it in GitHub Desktop.
Angular relation between component - Car
This file contains 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
@Component({ | |
selector: 'car', | |
template: '<wheel color="color"></wheel>', | |
}) | |
export class CarComponent implements OnInit { | |
color: string = 'red'; | |
} | |
@Component({ | |
selector: 'wheel', | |
template: '<screw color="color"></screw>', | |
}) | |
export class WheelComponent implements OnInit { | |
@Input('color') color: string; | |
} | |
@Component({ | |
selector: 'screw', | |
template: 'This is the color: {{color}}', | |
}) | |
export class WheelComponent implements OnInit { | |
@Input('color') color: string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment