It is possible to create attribute as global, I mean that attribute can be get & set in any lightning component or can we set the parent component attributes?
It is possible to create attribute as global, I mean that attribute can be get & set in any lightning component or can we set the parent component attributes?
Best Answer
There are couple ways to handle this
1.Approach 1 involves using a static resource file to store all the global values
Here is how a code in your static resource look like
And then in lightning component you will use like below
The controller
Note you can use this on all init handler to load this data
2.Use an attribute in Parent component and then trickle down the attribute in all the components like below
The child will have similar attribute and you will call like below