How to set a global boolean Observable

I would like to follow what explained in this post to display a header only on the sub pages. But how do I set a global boolean Observable?

You put the variable in a separate JS module that you require() from your viewmodels. As an example:


var Observable = require("FuseJS/Observable");
var bool = Observable(false);
module.exports = {
    bool: bool


var Common = require("Modules/Common");
module.exports = {
    theGlobalBool: Common.bool
<WhileTrue Value="{theGlobalBool}">
    <!-- ... -->

And don’t forget to add "Modules/*.js:Bundle" to your .unoproj file.

1 Like

Done! perfect.