Tutorial JavaScript does not work

It just won’t update the Button text. Neither on emulator or Android phone.

Here’s the code:

<App Theme="Basic" Background="#eeeeeeff">
    <DockPanel>
        <JavaScript>
            var Observable = require('FuseJS/Observable');
            var buttontext = Observable('Button');
            var clickcount = 0;

            function click() {
                buttontext.value = 'Clicks: ' + ++clickcount;
            }

           module.exports = {
                    buttontext : buttontext,
                    click : click
                }
        </JavaScript>
        <StatusBarBackground Dock="Top" />
        <ScrollView ClipToBounds="true">
            <StackPanel>
                <Slider />
                <Button Text="Button"/>
                <Switch Alignment="Left" />
            </StackPanel>
        </ScrollView>
    </DockPanel>
</App>

What am I doing wrong? I copied it from the tutorial page…

Thanks

Hi!

You are not actually data-binding to your buttontext variable. try <Button Text="{buttontext}" Clicked="{click}"/>

Thank you for the reply.

The Clicked="{click}" part although not here, was on my code.

But I missed the {buttontext} part.

Cheers!