Using a Javascript Function from Typescript

前端 未结 2 1343
暖寄归人
暖寄归人 2020-12-20 20:35

I am trying to build a nice windows phone application with an HTML front end. I want to use TYPESCRIPT to do my processing onto my html page. There is one javascript funct

2条回答
  •  独厮守ぢ
    2020-12-20 21:18

    You need to tell typescript that this function exists on window.external in order to use it. So :

    interface External{
        notify: Function;
    }
    
    if (window.external.notify != undefined)
        window.external.notify("your message");
    

提交回复
热议问题