Hi guys,
I’m stuck with Observable objects.
I’m making a simple registration page like this:
<DockPanel ux:Class="Registration">
<JavaScript File="registration.js" />
<StatusBarBackground Dock="Top" />
<ScrollView>
<TextInput Value="{name}" PlaceholderText="Insert Your Fist Name"/>
<Button Height="50" Text="Register" Clicked="{Register}">
</ScrollView>
</DockPanel>
This is my Javascript File:
var Observable = require('FuseJS/Observable');
var name = Observable("");
var isName = name.map(function(name){
return name != "";
});
function Register(){
debug_log(isName.value);
}
module.exports = {
Register: Register,
name: name
};
With the variable isName i check in real time if the variable name is not null.
But it doesn’t work in that way.
I see that this code works when i export the variable isName and if i ONLY USE IT in my ux file (for example if i use <Text Value="{isName}" />
)
It doens’t works untill i use that variable in my ux file…
Why? D:
Thanks for the help!