Using a Javascript Function from Typescript

前端 未结 2 1344
暖寄归人
暖寄归人 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:29

    //notif.js

    let notify = function(message) {
        alert(message);
    }
    

    //test.ts

    declare function notify(message: string): any;
    if(notify != undefined)
        notify("your message");
    

    Make sure notif.js is loaded first.

提交回复
热议问题