New Typescript 1.8.4 build error: “ Build: Property 'result' does not exist on type 'EventTarget'. ”

前端 未结 14 1886
情书的邮戳
情书的邮戳 2020-12-23 14:48

I am New to typescript. In my Durandal application I migrated to VS-2012 to VS-2015 means typescript 0.9 to typescript 1.8.4. After migrated I got so many build errors. I re

14条回答
  •  攒了一身酷
    2020-12-23 15:13

    Just let TypScript know what type you would expect it to be.

    Here is the fix:

    let reader = new FileReader();
    reader.onload = function (event){
        let fileUrl = (event.target).result;
    }
    

    You could also use reader.result instead in this case

提交回复
热议问题