So if we continue from where we left off in the previous article we had an index.js file that contained
now in order to turn this into a module all we have to do is export that function. But just to prove a point we'll do something slightly different. We'll export a new function that calls the existing one.
So what if we update the function we are trying to call through interop to be the exported and therefore public one?
so in index.razor change the code to
This still has a similar error and can't find the function.
Well remember we compared a module to being kind of like a C# class? Well at the moment we are trying to call a public method on the class before instantiating an instance of the class. (This isn't exactly the case, but as an analogy it works for me)
So before we can call it's methods we have to import the module.
Remove the following line from index.html