We use aura:attribute to share values between controllers and helpers, but this exposes the variable to parents components, because a parent component can set the value. How can I declare something like a private variable? Do you have any idea?
An example MyComponent
<aura:attribute name="myVar" type="Object"/>
My controllers use myVar
action1 : function (cmp ) {
cmp.set("v.myVar, 'some value');
action2 : function (cmp) {
cmp.get('myVar');
But other components can set my attribute in this way. I don't want this. Example
<c:MyComponent myVar='I don't want set myVar here' />