Merge "POST instantiation for Django-Angular"

This commit is contained in:
Jenkins 2014-12-06 00:18:50 +00:00 committed by Gerrit Code Review
commit 9aa0e14c34

View File

@ -9,8 +9,9 @@ var horizonApp = angular.module('hz', dependencies)
$httpProvider.defaults.xsrfCookieName = 'csrftoken';
$httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
}])
.run(['hzConfig', 'hzUtils', '$cookieStore',
function (hzConfig, hzUtils, $cookieStore) {
.run(['hzConfig', 'hzUtils', '$cookieStore', '$http', '$cookies',
function (hzConfig, hzUtils, $cookieStore, $http, $cookies) {
$http.defaults.headers.post['X-CSRFToken'] = $cookies.csrftoken;
//expose the configuration for horizon legacy variable
horizon.conf = hzConfig;
horizon.utils = hzUtils;