Sometimes I see in a project im working at, the following:
text="@{myVar}"
What does that @ do?
Edit: text is a property in, for example, a TextArea component.
Osteopathic medicine is a "whole person" approach to medicine—treating the entire person rather than just the symptoms. With a focus on preventive health care, Doctors of Osteopathic Medicine (DOs) help patients develop attitudes and lifestyles that don't just fight illness, but help prevent it, too.
A doctor of osteopathic medicine (D.O.) is a fully trained and licensed doctor who has attended and graduated from a U.S. osteopathic medical school. A doctor of medicine (M.D.) has attended and graduated from a conventional medical school.
An osteopath aims to restore the normal function and stability of the joints to help the body heal itself. They use their hands to treat your body in a variety of ways, using a mixture of gentle and forceful techniques. Techniques are chosen based on the individual patient and the symptoms they have reported.
MD stands for doctor of medicine. It is a designation that indicates someone who has completed medical school.
The @ symbol is used for two way binding. Traditional binding is only one way. So, you have something like this in ActionScript:
[Bindable]
public var myValue:String = 'test';
And this in MXML
<s:TextInput id="myInput" text="{myValue}" />
myValue is the source, and the text property on the myInput is the destination.
When the myValue variable changes, the text property of the TextInput will change. However, if you type into the myInput; the value of myValue will not change.
This is one way binding. Changing the source (myValue) changes the destination (myInput.text), but changing the destination (myInput.text) does not change the source (myValue).
When you add the '@' it creates a two way binding:
<s:TextInput id="myInput" text="@{myValue}" />
So, now whenever myValue changes, the text property of TextInput will change. ( As in the previous sample). Whenever myInput.text changes, the myValue will also change (Different from the previous sample).
The '@', basically, makes both the values (myValue and myInput.text) a source and destination for binding.
You could accomplish the same thing without the '@' by using the Binding tag:
<fx:Binding source="myInput.text" destination="myValue " />
Is that a more in depth explanation for you?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With