我想利用打字稿分型,爲您的Youtube API的數據在這裏:https://github.com/Bolisov/typings-gapi/tree/master/gapi.client.youtube-v3您可能需要一個合適的加載器來處理這種文件類型。打字稿
我使用離子框架,我收到以下後我不離子在下面的一行代碼即成錯誤:
gapi.client.load("client", "v3");
Module parse failed: /Users/yoko/Desktop/myApp/node_modules/gapi/lib/gapi.coffee Unexpected token (1:17)
You may need an appropriate loader to handle this file type.
| config = require './config'
|
| module.exports =
這是api.coffee怎麼看起來像
config = require './config'
module.exports =
server:
setApiKey: (apiKey) ->
config.api.key = apiKey
load: (apiName, apiVersion, callback) ->
@[apiName] = require "./#{apiName}/#{apiVersion}"
callback()
這是什麼意思?
意味着你需要設置cofeescript transpilation。 –
如何在角度項目中設置此項? –
需要使用加載程序,SystemJS或Webpack,或者您可以運行一個將文件編譯爲JS的監視任務,幷包含這些文件 –