funny thing is subtraction works but addition doesn’t. for addition, its is I think assuming as a string. So when I click my add button it makes it 55 rather than 10. Its the same code I have for both but just differnct names.
I’ve created an isolated case that works for me:
<App Theme="Basic">
<DockPanel>
<JavaScript>
var Observable = require("FuseJS/Observable");
var total = Observable(0);
var plus = 5;
function add_five() {
total.value += 5;
debug_log(total.value);
}
module.exports = {
total: total,
add_five: add_five
};
</JavaScript>
<StackPanel>
<Text Value="{total}" />
<Button Text="Add 5" Clicked="{add_five}" />
</StackPanel>
</DockPanel>
</App>
Are you able to try to isolate your case more or send us a project? If you’re unable to send your project because you don’t want it public, you can send it to use through this dropbox and only the fuse team will be able to see it: https://www.dropbox.com/request/ZgndLtJQm5eGzG9cicGK
I send you guys the code using this drop box link. Lemme know guys. Thanks.
mohamed.gika2@yahoo.com wrote:
Hi it is not 3 ! can you help me !
mohamed: You need to initialize you Observables with a number like this: var x = Observable(0);