I created a little test typescript/angularjs website.
I have this module with a static variable which I want to bind to the html-document so that I can see the current logged-in user.
module mytest.constants {
export class CurrentSession {
public static CURRENT_USER: string = "Tobi";
}
}
the problem is: the current scope is a controller which is separated from my CurrentSession-class.
I would like to do something like
<div class="label" style="color:green">
Logged in as: {{mytest.constants.CurrentSession.CURRENT_USER}}
</div>
Another way I could do is to add a class-member to the controller and set it in constructor like:
this.CurrentUSer = mytest.constants.CurrentSession.CURRENT_USER
but I would prefer to bind the static-variable directly to the html-file.
is this possible?