Hi!
I figured that I could try to make my code work like “OOP” JavaScript (based on http://www.phpied.com/3-ways-to-define-a-javascript-class) to keep it more tidy as I am concatenating it since this is what Fuse seems to like the most.
But I am getting some strange errors, so I made a test-case:
<!-- MainView.ux -->
<App Theme="Basic">
<JavaScript File="js.js" />
<StackPanel>
<Text Value="{hei}" TextAlignment="Center"/>
<Button Text="Hade" Clicked="{hade}" />
</StackPanel>
</App>
//js.js
var Observable = require("FuseJS/Observable");
var test = new function() {
this.hei = Observable("hei");
this.hade = function() {
console.log(this.hei.value);
}
}
module.exports = {
"hei": test.hei,
"hade": test.hade
}
I have also tried using ES6 classes transpiled through babel without luck. It didn’t return an error, but I could not manage to refer to the variables. Example:
let Observable = require('FuseJS/Observable');
export class test {
construct() {
this.hei = Observable("Hei");
}
hade() {
this.hei.value = "hade";
}
}
Is this or any of the examples in the article at all supposed to work? It would be great with support for this as it’s really helpful for avoiding duplicate variables and stuff like that.