The @Value Decorator
This article requires knowledge of Properties
Main
The @Value
decorator allows you to access properties from your properties.json in a programatic way, this means, by using the @Value
decorator, you can interact with your configuration in your components or native classes.
Usage
Syntax:
propertyKey
Key reference of your property. If nested, please separate by using dots (.)
Example:
In the example above we can see how we are using @Value
on top of two different class fields: one that is static, and one that is not. Although, it works for both.
In the example above, we can also see how we are using nested properties with the @Value
decorator.
Last updated