3
使用$http
時,回調函數使用標頭獲取器調用。這通常會導致以下代碼:
$http.get('example.json').success(function(data, status, headersGetter, config) {
var headers = headersGetter();
// Do stuff
});
爲什麼headerGetter傳遞給回調函數而不僅僅是作爲對象的頭文件?
爲什麼downvote? – 2014-10-31 08:19:58
可能重複[可以提供單個gettable/settable變量的服務是否可以簡化?](http://stackoverflow.com/questions/24184829/can-a-service-that-provides-a-single-gettable-settable -variable待簡化的) – 2015-09-03 05:17:19