i followed the directions from this post:
here is my user.js service:
'use strict';
staticApp.factory('user', ['$scope', '$http', '$q', '$location', function ($scope, $http, $q, $location) {
  $http.defaults.useXDomain = true;
  var host = 'http://' + window.location.hostname + ':5001';
  return {
    current: function() {
      var d = $q.defer();
      var user = $http({method: 'GET', url: host + '/api/user.json'});
      user.success(function(resp) {
        console.log('SUCCESS! logged in!');
        d.resolve(resp.user);
      });
      user.error(function(resp) {
        console.log('not logged in!');
        var login_url = 'http://path/to/login/';
        scope.$apply(function() { $location.path(login_url); });
      });
      return d.promise;
    }
  };
}]);
i am running a python flask server for the app's API.
this piece of code executes fine when i have authenticated already:
user.success(function(resp) {
  console.log('SUCCESS! logged in!');
  d.resolve(resp.user);
});
however, when i have not authenticated and this piece of code executes:
user.error(function(resp) {
    console.log('not logged in!');
    var login_url = 'http://path/to/login/'
    scope.$apply(function() { $location.path(login_url); });
 });
i get this error:
Error: Unknown provider: $scopeProvider <- $scope <- user <- navigationDirective
 
    