I get: [ts] 'Promise' only refers to a type, but is being used as a value here

前端 未结 2 399
情歌与酒
情歌与酒 2021-01-14 04:39

I\'m taking an Angular2 course and following along. Everything I have been doing thus far for all the other exercise has worked fine until I got to creating this custom vali

2条回答
  •  天命终不由人
    2021-01-14 05:12

    You need to target ES6, or else use a polyfill library like bluebird. If you are targeting ES5 in the compiler output, then it will fail like this because ES5 has no Promises.

提交回复
热议问题