Currently, I am utilizing Aurelia in combination with TypeScript.
In my code, I have defined a simple type with static variables as shown below:
export class MyModule {
static foo = false;
}
Furthermore, I have created an Aurelia view model as follows:
import {MyModule} from 'my-module';
export class MyViewModel{
constructor() {
MyModule.foo = true;
console.log(MyModule.foo); // Result will be true
}
}
My intention is to access this static member within my view, demonstrated by the following example:
<p if.bind="MyModule.foo">
This content will be visible because foo has been set to true.
</p>
However, when referencing the static members of the imported type in the view model, it appears that I am facing some difficulties.
It seems like I may have misunderstood one (or more) concepts within the Aurelia framework. :)