window.g = window var app = angular.module('app', []) app.config(['$interpolateProvider', '$httpProvider', function($interpolateProvider, $httpProvider) { $interpolateProvider.startSymbol('{(') $interpolateProvider.endSymbol(')}') $httpProvider.defaults.xsrfCookieName = 'csrftoken' $httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken' $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest' //$routeProvider.when('/', {templateUrl: '.....'}) }, ]) app.run(['$rootScope', '$timeout', '$http', function run($rootScope, $timeout, $http) { g.$http = $http // Debug g.$timeout = $timeout // Debug }, ]) app.controller('TestCtrl', ['$scope', '$http', function TestCtrl($scope, $http) { var test = g.test = this //$http.get('/api/users/?is_admin=False').then(function(res) { // test.users = res.data.results //}) test.x = null $scope.$watch( function() {return test.x}, function(newVal, oldVal) { if (newVal !== oldVal) console.log(test.x) } ) }])