鍍金池/ 問(wèn)答/HTML5  HTML/ 如何將<script>標(biāo)簽中的回掉函數(shù)寫(xiě)到AngularJS的con

如何將<script>標(biāo)簽中的回掉函數(shù)寫(xiě)到AngularJS的controller中

<script type='text/javascript' src='https://www.xxx.com?callback=response' async defer></script>

將以上代碼放到html中,如何能夠觸發(fā)到對(duì)應(yīng)controller中定義的

$scope.response=function(){}

函數(shù)?

回答
編輯回答
薔薇花

請(qǐng)問(wèn)你的script是使用什么方式執(zhí)行response呢,

一般這些外部回調(diào)函數(shù)可以掛在全局window下,就可以直接訪問(wèn)了

2017年3月7日 11:07