javascript / beginner
Snippet
Receiving Data with @Input
The @Input decorator marks a class property as an input, allowing a parent component to pass data down into this child component.
snippet.js
javascript
1
@Input() userRole: string = 'Guest';
angular
Breakdown
1
@Input()
A decorator that tells Angular this property can be set by a parent component.