0

I created a WinJS-Application [Windows-10-UWP] converted the code to Typescript.
Now I have a Windows-Runtime-Component, which I want to refer to in my .ts files.
I allready achieved this in the normal javascript by following the instructions given here. But I have no idea to achieve this in Typescript. The main problem here is, that I am not able to create a reference to the Window-Runtime Component. Is this even possible?

1 Answer 1

1

The main problem here is, that I am not able to create a reference to the Window-Runtime Component. Is this even possible?

Yes, it is possible. If you have referenced the Windows Runtime Component in your main project. The namespace will be stored in the global window object. So you can access the Windows Runtime Component like below:

let variable= window["MyTestComponent"];
Sign up to request clarification or add additional context in comments.

3 Comments

Thank you for your reoly. I will Test it as soon as possible
It works, but i get the message that there is a typedef missing and i don't know which type is needed here.
use any type: let variable:any=window["MyTestComponent"].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.