I am currently getting into typescript and webpack, but right now I am lost on how to solve this problem:
I want to call a function inside my typescript class when a form is being submitted. There is no magic involved just yet, but I just can't figure out how to make the functionality accessible to my form, I am constantly facing the problem that the function is not defined, so something must be missing to make it available to the window namespace.
This is my .ts file:
class Login {
loginAccount() {
console.log("test");
debugger;
}
};
export const login = new Login();
as you can see, no magic in here. I'm just trying to get the call done as of now.
This file is imported in my webpack like this (inside my index.ts):
import './Login/login.ts';
The form in my html file looks like this:
<form onsubmit="login.LoginAccount(); return false;">
Email: <input type="text" name="email"><br>
Password: <input type="text" name="password"><br>
<input type="submit" name="Submit" value="Submit"/>
</form>
I just can't get this to work. I am sure that the solution is fairly simple, but after 30 minutes of googling this I mostly found solutions which deal with this in a jackhammer way.